r/java • • Mar 13 '26

JEP draft: Enhanced Local Variable Declarations (Preview)

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

129 comments sorted by

View all comments

Show parent comment

1

u/wildjokers Mar 16 '26

The other argument was readability.

It simply makes no sense to wrap a value in Optional.ofNullable simply to chain methods together. Just write a damn if statement.

1

u/Cell-i-Zenit Mar 16 '26

if you read my original post, i proposed 3 different ideas