Bug in JDK25 with switch statements

Remi Forax forax at univ-mlv.fr
Fri Mar 21 09:54:16 UTC 2025


Hello Raphael, 
It may be hard to reproduce, 
can you do a javap -c on the class/method so it will be easier to see if the generated bytecode is wrong of if it's a VM issue. 

regards, 
Rémi 

> From: "Rafael Winterhalter" <rafael.wth at gmail.com>
> To: "compiler-dev" <compiler-dev at openjdk.org>
> Sent: Friday, March 21, 2025 10:20:48 AM
> Subject: Bug in JDK25 with switch statements

> Hello,
> my project Byte Buddy fails to build with recent JDK 25s. I am not sure if this
> is a known bug, but I wanted to mention it: [
> https://github.com/raphw/byte-buddy/actions/runs/13975513319/job/39131008617 |
> https://github.com/raphw/byte-buddy/actions/runs/13975513319/job/39131008617 ]

> The reason for the build failure is that this switch statement ends up in the
> default branch: [
> https://github.com/raphw/byte-buddy/blob/master/byte-buddy-dep/src/main/java/net/bytebuddy/asm/Advice.java#L3239
> |
> https://github.com/raphw/byte-buddy/blob/master/byte-buddy-dep/src/main/java/net/bytebuddy/asm/Advice.java#L3239
> ]

> This is happening for the char 'p' which is the last legal branch of the switch.
> This does not yield an error on JDKs 5 to 24, so this must be introduced
> recently.

> Thanks, Rafael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/compiler-dev/attachments/20250321/5748a94f/attachment.htm>


More information about the compiler-dev mailing list