Enhanced Local Variable Declarations #Java JEP draft is published!
https://bugs.openjdk.org/browse/JDK-8357464
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?

Fun fact: #IntelliJIDEA still supports this feature! Use language level 20 (Preview) (which is not officially supported anymore). Write code like:

import java.util.List;

class Test {
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);
}
}
}

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);
}
}

@tagir_valeev I sometimes wonder how many of these pattern matching samples incentivize bad design. I have yet to see an example in which it wouldn’t have been better to simply call a method on the object. This here in particular feels like an utterly complex way to write list.forEach(Object::toString); 🤷‍♂️
@odrotbohm you may not have every possible algorithm available directly as a record member. Sometimes, you need something new right here.
@tagir_valeev *I* get that. I just think about newbies not as proficient in OO design.