[jdk17] RFR: 8268766: Desugaring of pattern matching enum switch should be improved [v3]

Jan Lahoda jlahoda at openjdk.java.net
Tue Jun 22 19:41:56 UTC 2021


On Fri, 18 Jun 2021 14:35:42 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Updating javadoc, code and tests as suggested.
>
> src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 175:
> 
>> 173:      * Bootstrap method for linking an {@code invokedynamic} call site that
>> 174:      * implements a {@code switch} on a target of an enum type.  The static
>> 175:      * arguments are an array of case labels which must be non-null and of type
> 
> This sentence can still be improved and made cleared. Example:
> 
>> The static arguments are used to encode the case labels associated to the `switch` construct, where each label can be encoded as a `String` (e.g. to represent an enum constant), or, alternatively, as a `Class` (e.g. to represent a type test pattern whose type is an enum type).

Thanks. I've updated the javadoc and improved the validation a little, checking the `Class` objects provided.

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

PR: https://git.openjdk.java.net/jdk17/pull/81


More information about the compiler-dev mailing list