On Fri, 3 Nov 2023 15:24:48 GMT, Jan Lahoda <[email protected]> wrote:
>> src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 346:
>>
>>> 344: Class<?> clazz =
>>> label.constantType().resolveConstantDesc(lookup);
>>> 345:
>>> 346: if (value.getClass() != clazz) {
>>
>> Not related to this patch, but this appears to be wrong: we should do
>> something like
>>
>> if (!(value instanceof Enum<?> ev) || ev.getDeclaringClass() != clazz)
>> return SENTINEL; // or false
>
> You are right, of course, but let's solve that under
> [JDK-8318144](https://bugs.openjdk.org/browse/JDK-8318144), to ensure that
> can more easily be backported. Tests are running on the fix, will publish PR
> once they pass. Thanks!
FYI:
https://github.com/openjdk/jdk/pull/16499
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16489#discussion_r1381950105