Tagir Valeev

Tagir Valeev

@tagir-valeev.bsky.social

Work at JetBrains. Java Champion. Check my Java book: https://mng.bz/671p

375 Followers 29 Following 79 Posts Joined Jan 2025
12 hours ago
Inspection warning: "Can be replaced with enhanced 'for' with a record pattern" Resulting code screenshot (available in the post anyway)

Now, you'll get an inspection warning with a quick-fix proposing to use the deconstruction pattern!

void print(List<Point> list) {
for (Point(int x, int y) : list) {
System.out.println(x + ":" + y);
}
}

3 0 0 0
12 hours ago
Language level selection dialog in IntelliJ IDEA

Fun fact: #IntelliJIDEA still supports this feature! Use language level 20 (Preview). Write code like:

record Point(int x, int y) {}
void print(List<Point> list) {
for (Point point : list) {
int x = point.x();
int y = point.y();
System.out.println(x + ":" + y);
}
}

0 0 1 0
12 hours ago
Loading...

Enhanced Local Variable Declarations #Java JEP draft is published!
bugs.openjdk.org/browse/JDK-8...
Do you remember that the "records in for-each statements" feature was previously a part of JEP 432 and delivered to Java 20 (preview), but dropped since Java 21?

3 2 1 0
2 weeks ago
Preview
Angebot: Ein Tag in der Welt der Softwareentwicklung München | 23. April 2026, 10:00 | JetBrains GmbH, München mit Ekaterina Popova

Girls’ Day at the JetBrains office in Munich, Apr 23rd. The registration is open here: www.girls-day.de/.oO/Show/jet...

0 0 0 0
1 month ago
Glean answer:

In building ... today’s siren is just a scheduled test and you do not need to leave
your workplace while it's running.

If you're unsure or something seems off (e.g. smoke, smell, people evacuating), call Munich building emergency number ... or ask at reception immediately.

We have AI assistant Glean integrated into the Slack, and it answered privately to her: "today's siren is just a scheduled test and you do not need to leave your workplace". It was not a test or a drill, it was a real fire alarm. Someday, AI will kill us.

87 33 3 5
1 month ago
Image of fire brigade near our office

Today we had a fire alarm in the office. A colleague wrote to a Slack channel 'Fire alarm in the office building', to start a thread if somebody knows any details.

25 5 2 1
1 month ago

Just seen on a code review:

> .groupBy({ it.second }, { it.first })

People may think it's short and concise. I think, it's cryptic and unreadable. You have to go several lines above and find `to` inside one of previous lambdas to finally understand what is `it.first` and what is `it.second`.

4 0 1 0
2 months ago
import kotlin.system.measureTimeMillis

fun main() {
    val set = (0..10000000).toCollection(linkedSetOf())
    repeat(5) {
        val time1 = measureTimeMillis { set.last }
        println("set.last call took $time1 ms")
        val time2 = measureTimeMillis { set.last() }
        println("set.last() call took $time2 ms")
    }
}
set.last call took 1 ms
set.last() call took 71 ms
set.last call took 0 ms
set.last() call took 63 ms
set.last call took 0 ms
set.last() call took 58 ms
set.last call took 0 ms
set.last() call took 61 ms
set.last call took 0 ms
set.last() call took 57 ms

Fun with #Kotlin: a pair of parentheses may cost you a lot!

4 1 0 0
2 months ago

In today crazy #Java series: this code works (with Java 25):

<T extends Integer> void test(T t) {
t++;
//t+=1;
IO.println(t);
}

void main() {
test(10);
}

But if you replace t++ with t+=1, it stops working!
Main.​java:3: error: incompatible types: int cannot be converted to T

11 1 1 0
3 months ago
Preview
Nullability, JSpecify, and IntelliJ with Andrei Kogun and Tagir Valeev YouTube video by Coffee + Software

Had a talk about JSpecify and IntelliJ IDEA on Coffee + Software channel www.youtube.com/live/K9QIYZM...

3 1 0 0
3 months ago
Post image

Nice commit github.com/stack-auth/s...

2 0 0 0
3 months ago
Preview
What's New in IntelliJ IDEA 2025.3 Explore IntelliJ IDEA's latest features and updates to elevate your professional Java and Kotlin development experience.

The IntelliJ IDEA 2025.3 release has landed!

This version brings several significant updates, all of which are described and demoed on our What’s New page.

Check it out! 👇

48 12 4 2
3 months ago

Think positive. You have a good chance now to become the longest living person in your town or even state. You can also compete in a local running event in the M75 age category with good chances to win!

0 0 0 0
3 months ago

I don't know what is sadder: AI that thinks up the things in the absence of reliable information, or people who blindly trust it without checking the sources (there aren't any).

1 0 1 0
3 months ago

The funny thing is that a person today tried to convince me that this is true. While I don't know your real age, I was like 'huh? Can't be true'. He showed the Google search result as a proof.

0 0 1 0
3 months ago
Post image

@briangoetz.bsky.social are you really this old? 😱

1 0 2 0
3 months ago

Will you expect this code to be JSpecify-compliant? If not, then how to fix it?

@NullMarked
public final class Demo {
List<String> removeNulls(List<@Nullable String> input) {
return input
.stream().filter(Objects::nonNull).toList();
}
}

0 1 1 0
4 months ago

You can find the discussion here: youtrack.jetbrains.com/issue/IDEA-3...

2 0 0 0
4 months ago
Preview
Null-Safe applications with Spring Boot 4 Level up your Java code and explore what Spring can do for you.

Don't miss my new blog post in the Road to GA series to learn how the Spring team empowers Spring developers to make their Spring Boot 4 application null-safe, to reduce or remove the risk of NullPointerException and to solve "the billion dollar mistake"! spring.io/blog/2025/11...

#spring #java

41 22 0 1
4 months ago

Oh, we had this in my previous job! I can tell you what can go wrong: the limited size of the class constant pool! We actually started hitting it when tried to add more stuff into that huge Utils class.

0 0 2 0
4 months ago
Post image

A user reports wrong highlighting in IntelliJ IDEA: the code is red, but both javac compiler and ecj compiler compile the code successfully, using any version of compiler. Next you read the spec and realize that IntelliJ IDEA behavior is correct, and both compilers are wrong. Weird feeling.

10 0 1 0
4 months ago

Days since I mixed 'ExpressionUtils' and 'ExceptionUtils': 0

4 0 1 0
5 months ago
Post image Post image

Is it official now to call the taskbar notification area as 'tray'? I remember Raymond Chen saying that this is wrong 🤔 devblogs.microsoft.com/oldnewthing/...

0 0 0 0
5 months ago

Fixed a static analysis warning in a Java file in the repo
.
.
.
It was a demonstration Java file used to onboard users and teach them about IntelliJ IDEA inspections and quick-fixes. The warning was there to illustrate how inspections work 🤦

4 0 0 0
5 months ago
Post image Post image

TIL: In #Java, List.subList() and List.reversed() are implemented smartly. You may call these methods as many times as you want and in any order, but you don't get a long chain of references which leads to StackOverflowError. The longest chain of views is two: reversed -> subList -> original list.

12 5 0 0
5 months ago

Implemented Comparator.min/max for the Java standard library. Should be available since Java 26.
❌comp​.compare(a, b) >= 0 ? a : b
✅comp.max(a, b)
bugs.openjdk.org/browse/JDK-8...

9 2 0 0
5 months ago
Java 25 / JDK 25: General Availability

Java 25 / JDK 25: General Availability: mail.openjdk.org/pipermail/jd...

Features: openjdk.org/projects/jdk...

Downloads: jdk.java.net/25/

#Java25 #JDK25 #OpenJDK #Java

81 52 0 3
5 months ago
Preview
Java 25 LTS and IntelliJ IDEA | The IntelliJ IDEA Blog Full support for Java 25 is available in IntelliJ IDEA!

Java 25 LTS is here! 🚀 Ready to tap into the latest #Java features? #IntelliJIDEA supports Java 25 from day one. Let’s dive into what’s new and how your IDE has you covered! 👇 #Java25IntelliJIDEA jb.gg/r70wns

38 16 0 1
5 months ago
Post image Post image Post image

JetBrains AI Assistant is quite useful for adding Maven dependencies. Take care, though, to update the versions to the latest, as its learning set is somewhat outdated. To update the version, invoke good old code completion.

1 0 1 0
5 months ago
JDK 25

Looks like today is the day for JDK25!

openjdk.org/projects/jdk...

#java

18 6 1 0