Java Pulled Primitive Patterns After Five Previews. JDK 28 Won't Compile Them.
- Created
- 25 Nov 2026
- Last reply
- 4 minutes ago
- Replies
- 0
- Views
- 0
- Reactions
- 0
Discussion of the blog article Java Pulled Primitive Patterns After Five Previews. JDK 28 Won't Compile Them..
Primitive types in patterns, instanceof, and switch previewed in every JDK from 23 to 27. On November 9 the Amber team withdrew the feature, and it won't be in JDK 28 even with --enable-preview. Here's why Valhalla changed the plan, what replaces it, and how to rewrite code that used it.
Discussion thread — share findings, corrections and follow-ups below.