> 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

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/33919/files
  - new: https://git.openjdk.org/jdk/pull/33919/files/66f9bfeb..b220172a

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=33919&range=06
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=33919&range=05-06

  Stats: 51654 lines in 1326 files changed: 33697 ins; 7301 del; 10656 mod
  Patch: https://git.openjdk.org/jdk/pull/33919.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/33919/head:pull/33919

PR: https://git.openjdk.org/jdk/pull/33919

Reply via email to