On Fri, 27 Nov 2026 09:33:04 GMT, Aggelos Biboudis <[email protected]> wrote:
>> Removes the preview implementation of Primitive Types in Patterns, >> `instanceof`, and `switch` from JDK 28. The compiler rejects the withdrawn >> constructs even with `--enable-preview`. The changes restore the pre-preview >> language rules while preserving subsequent fixes and update JShell, >> diagnostics, and regression tests. >> >> 1. `SwitchBootstraps.typeSwitch` uses JDK 27’s preview-disabled behavior >> regardless of whether preview is enabled. It continues to accept primitive >> selector descriptors and primitive `Class` labels, including exact numeric >> matching for primitive selectors against primitive `Class` labels. This >> preserves compatibility with non-preview record-pattern binaries compiled by >> javac on JDK 23–27. It rejects `Long`, `Float`, `Double`, and `Boolean` >> constant labels with `IllegalArgumentException`. >> 2. `ExactConversionsSupport` and all its public methods remain available. >> Its Javadoc removes links to the withdrawn preview specification. >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > Aggelos Biboudis has updated the pull request with a new target base due to a > merge or a rebase. The incremental webrev excludes the unrelated changes > brought in by the merge/rebase. The pull request contains eight additional > commits since the last revision: > > - Merge branch 'master' into primitive-patterns-removal > - Add TestJsonNumber.java to test/jdk/ProblemList > - Align SB with CSR proposal > - Update JavaDoc of typeSwitch > - Drop the newly introduced IAE check for a void.class label > - Diagnostic changes now remain only in compiler.properties > - Address review > - 8397218: Remove Preview Implementation for Primitive Types in Patterns, > instanceof, and switch lgtm ------------- Marked as reviewed by vromero (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/33919#pullrequestreview-6122149145
