Serguey Asael Shinder: Primitive patterns are withdrawn after five previews and leave JDK 28
The Java language team has dropped a feature that had been in preview for five releases. In a message to the amber-spec-experts list on 9 November, Withdrawing the Primitive Patterns preview feature, signed by Angelos Bimpoudis and Gavin, the Amber team writes that development of Primitive Types in Patterns, instanceof, and switch has stopped. Inside Java carried the announcement on 11 November.
The feature had a long run. It first appeared as a preview in JDK 23 (JEP 455) and was previewed again in JDK 24 (JEP 488), JDK 25 (JEP 507), JDK 26 (JEP 530) and JDK 27 (JEP 532). A draft JEP for a sixth preview will now be withdrawn, and the feature will be removed from JDK 28. The message is explicit that it will no longer be available there, even with --enable-preview.
The reason given is not a flaw in the feature but a conflict with work elsewhere. One of its design highlights was exact numeric conversion: a pattern can tell a lossy conversion of a primitive value from a non-lossy one. Project Valhalla is exploring a new model for Java numerics, possibly including user-defined numeric types, and any new numeric type would need to support exact conversion as well. With Valhalla still changing, the authors say it would be premature to fix the current definition in the language.

Withdrawing a preview is unusual, the message notes, but JEP 12, which governs preview features, anticipates it and allows removal through a JBS issue without a new JEP.
Part of the work survives. The team plans a different feature, Constant Patterns, which already carries forward expanded primitive support in switch expressions and statements. It lets some constants appear as patterns, nested inside record patterns: the example given is case Point(0, 0). That would make patterns shorter and remove some when clauses from switch blocks. A draft JEP is expected shortly.
If you have experimented with primitive patterns on JDK 27 with preview enabled, this is the practical consequence: that code will not compile on JDK 28. It is the reason preview features carry the flag at all, and it is a good moment to check whether any build, test suite or sample in your repositories quietly depends on one.