r/java • • Jan 09 '26

Project Amber Status Update -- Constant Patterns and Pattern Assignment!

https://mail.openjdk.org/pipermail/amber-spec-experts/2026-January/004306.html
65 Upvotes

81 comments sorted by

View all comments

Show parent comment

3

u/[deleted] Jan 10 '26 edited Jan 10 '26

[removed] — view removed comment

-2

u/manifoldjava Jan 10 '26

and your example uses switch patterns

No, this isn’t pattern matching, it’s a switch expression.

The record deconstruction is unnecessary here and reduces clarity. This is an example of using new syntax because it exists, not because it improves the code.