On Mon, 16 Nov 2026 15:56:41 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).

This pull request has now been integrated.

Changeset: 97a5ffac
Author:    Aggelos Biboudis <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/97a5ffac4ddd7c5f69b95a848a92e5015c4e34d8
Stats:     4854 lines in 69 files changed: 690 ins; 4050 del; 114 mod

8397218: Remove Preview Implementation for Primitive Types in Patterns, 
instanceof, and switch

Reviewed-by: jlahoda, mcimadamore, vromero

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

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

Reply via email to