Tagir Valeev Profile picture
Work at @JetBrains. Develop @Java support in @IntelliJIDEA. Views are my own. Java Champion. Check my Java book: https://t.co/EM5VRVhiBJ
Mar 9 17 tweets 3 min read
Пара непрошеных советов тем, кто планирует сдавать немецкий. Во-первых, это не так сложно. Я прошёл учебник B1 только на четверть, мне надоело тратить время на групповые занятия. Это не помешало сдать экзамен на 95% Да, я ботаю дополнительно — учу слова в анки, читаю новости, детские книжки и твиты на немецком, стараюсь общаться с людьми, насколько это возможно. Но вообще-то проходной балл 60%. Кажется, что минимально сдать B1 можно, если вы уверенно закончили курс A2.
Oct 27, 2023 14 tweets 5 min read
Ok, let's take a closer look at this problem. Thank you for the readers for the analysis, especially for @shipilev. It appears that in later versions of Java the problem is also visible, but you need to compare -g:none with -g First, a quick reminder about how lambdas are normally compiled to bytecode. Let's compile a very simple lambda and take a look at the bytecode. Image
Feb 8, 2023 20 tweets 3 min read
Субъективный опыт, на что уходит время при написании линтеров.
Линтер можно представить как три куска. Первый - он один на весь линтер. Это обвязка для запуска рулов/детекторов/инспекций, чтение конфигурации, импорт/экспорт результатов, интеграция с системами сборки, CI, плагины в IDE.
Jan 15, 2023 10 tweets 2 min read
Applying static analyzer suggestions to the code you don't maintain is not so trivial. This is not how you should start. github.com/netty/netty/pu… If you really want to contribute, find the static analyzer warning, which really causes the problems, find real bug. Ideally, write a unit test that demonstrates the buggy behavior.
Jan 14, 2023 8 tweets 2 min read
On API compatibility. IntelliJ IDEA has the code model for Java language. In particular, we have PsiForeachStatement interface, which represents for-each loop like for(int x: data) {}. This interface has getIterationParameter() method, which returns the variable x. Our parser works in the way that if for-each loop is parsed, this variable is always present. When the loop is malformed (e.g. simply for() {} with empty parentheses, or for(:) {}), it's parsed as PsiForStatement with some PsiErrorElement inside.
Jun 9, 2021 21 tweets 7 min read
Thanks to everybody who participated! Let's dig into this puzzle. We have a HashSet<StringBuilder> here (which has a HashMap inside), we fill it with some objects, then we add one more StringBuilder (sb), and it's correctly added (contains() returns 'true'). Next, we modify the sb contents and contains() returns 'false' now. How it's possible?