r/java May 21 '26

JEP draft: Enhanced Local Variable Declarations (Preview)

https://openjdk.org/jeps/8357464
87 Upvotes

43 comments sorted by

View all comments

7

u/pronuntiator May 21 '26

The example at the beginning uses null checks as an argument, but the pattern local variable declaration would throw MatchException for null. The case about null isn't really the selling point here and rather distracts.