RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v44]

Vicente Romero vromero at openjdk.org
Wed Jan 24 15:40:37 UTC 2024


On Wed, 24 Jan 2024 15:26:54 GMT, Aggelos Biboudis <abimpoudis at openjdk.org> wrote:

>> This is the proposed patch for Primitive types in patterns, instanceof, and switch (Preview).
>> 
>> Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/
>
> Aggelos Biboudis has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Enhance Javadoc of ExactConversionsSupport (2)
>  - Enhance Javadoc of ExactConversionsSupport

src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 471:

> 469:                                     // o instanceof float
> 470:                                     Label notNumber = cb.newLabel();
> 471:                                     cb.aload(0);

we are wiring constants into code generation: `0`, `3` etc, probably those won't change but I would prefer using static final fields or enums, that can be documented and changed easily in the future if needed

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465107903


More information about the core-libs-dev mailing list