Java Language Team Withdraws Primitive Patterns After Five Previews, Saying the Feature Will Be Removed From JDK 28 and Constant Patterns Is Planned
The Java language team says it has ceased development of Primitive Types in Patterns, instanceof, and switch after five previews; the feature will be removed from JDK 28, and Constant Patterns is planned.
Editor's Note ·
- Clarification:
- The article says 'The Inside Java post credits Angelos Bimpoudis and Gavin Bierman.' The Inside Java page cited as the source shows no byline and no date; those details appear in Inside Java's feed (not cited), and the date is also in the post's URL. The email on the OpenJDK list is sent by Angelos Bimpoudis and signed 'Angelos & Gavin'.
- Clarification:
- The headline and summary say 'Java language team'. No cited source uses that term: the email's authors write 'we' and describe themselves as 'stewards of the Java language', and Inside Java's About page says its posts do not necessarily represent an 'official view' of the team or of Oracle. The quoted wording of the decision is the email's own.
Overview
The team that stewards the Java language has decided to stop developing Primitive Types in Patterns, instanceof, and switch, a feature that had been in preview since JDK 23. According to an email to the amber-spec-experts mailing list, the draft JEP for a sixth preview “will be withdrawn, and the feature will be removed from JDK 28”. The email says the team plans to introduce a different feature, Constant Patterns. Inside Java, a site for members of the Java team at Oracle, published a short notice of the decision on November 11, 2026.
What the Announcement Says
The email is dated November 9, 2026 in the list archive, which shows the sender’s time (6:28 p.m.) without naming a time zone. The Inside Java post credits Angelos Bimpoudis and Gavin Bierman. It opens: “We have decided to cease development of Primitive Types in Patterns, instanceof, and switch.” The post itself is a pointer to the email, which carries the rationale.
The email lists the feature’s history: a preview in JDK 23 (JEP 455), then further previews in JDK 24 (JEP 488), JDK 25 (JEP 507), JDK 26 (JEP 530) and JDK 27 (JEP 532). Each of those JEP pages shows the status “Closed / Delivered” in the release named. As previously reported, JDK 27 reached general availability on September 15 with the feature at its fifth preview.
The stated reason concerns Project Valhalla. The email says that project “has been exploring a new vision for Java numerics, including the possibility of user-defined numeric types”, that new numeric types “would need to support exact numeric conversion, and vice versa”, and that “Given that the Valhalla work is still evolving, it would be premature to finalize Primitive Types in Patterns with their current definition of exact numeric conversion.” It describes exact numeric conversions as one of the feature’s design highlights, because they let pattern matching tell lossy conversions of primitive values from non-lossy ones.
On process, the email says “withdrawing a preview feature is unusual” but is an outcome anticipated by JEP 12. JEP 12 says that when an owner decides to remove a preview feature, the owner files a JBS issue to remove it in the next feature release, and “no new JEP is needed”. The email adds that the feature “will no longer be available in that release, even with —enable-preview”. The Herald reads this to mean that source code using the preview feature would need changing before it can build on JDK 28.
The Planned Sixth Preview and the Replacement
Draft JEP 8393282, titled as the sixth preview, lists its creation on 2026/09/30 and its last update on 2026/10/13. It proposed a further preview in JDK 28 by improving the dominance rules for case labels and clarifying how a switch label is selected at run time, and said the feature would stay in preview while the team refined its relationship with constant patterns. The page still showed the status “Draft” when the Herald fetched it on November 11.
For Constant Patterns, the email says the design “already carries forward work from Primitive Patterns, including expanded primitive support in switch expressions and statements”, lets some constants appear as patterns nested in record patterns (for example case Point(0, 0)), and that “A draft JEP for Constant Patterns will appear shortly.” In a January 9, 2026 email, Gavin Bierman had described Constant Patterns as support for “a subset of constant expressions, including null, to appear as nested patterns”, and had written that primitive patterns were then the one Amber feature in preview.
How Independent Coverage Had Described the Feature
None of the independent sources cited here reports on the withdrawal; they predate it. InfoWorld reported on September 15 that the feature “is in a fifth preview” in JDK 27. Simon Ritter, Deputy CTO of Azul, wrote in an InfoWorld contributed column dated October 5 that it was “of particular interest to me” and “delivered without change in JDK 27”.
InfoWorld’s report on a March 17 JavaOne presentation by Dan Smith of Oracle’s Java platform group said that he cited planned features “but added that these features may change or go away instead”. The article lists primitive types in patterns, then in its fourth preview in JDK 26, among the features Smith cited.
JDK 28 Context
OpenJDK’s JDK 28 project page, last updated 2026/11/2 14:47 UTC, lists Rampdown Phase One on 2026/12/03 and general availability on 2027/03/09. Its list of JEPs targeted so far includes JEP 401, Value Objects (Preview), and does not include primitive patterns. JEP 401’s own page shows the status “Integrated” for release 28. Ritter, in the same column, called JEP 401 and JEP 539 “the first real parts of Project Valhalla” in JDK 28. The withdrawal email does not mention JEP 401, and none of the cited sources says that JEP 401 played a part in the decision, so this article draws no connection between them.
What We Don’t Know
The email does not say whether primitive patterns will return in some form or when the exact-conversion question is expected to be settled. It gives no release for Constant Patterns and says that a draft JEP “will appear shortly”. When the Herald fetched the list archive on November 11, the thread listed one participant, the sender.