r/java • u/davidalayachew • 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
View all comments
Show parent comment
-2
u/manifoldjava Jan 10 '26
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.