lambda method naming changes in jdk 24

Egor Ushakov egor.ushakov at jetbrains.com
Fri Jul 11 15:08:24 UTC 2025


Hi everyone!

it looks like in jdk 24 compiler started naming lambda methods slightly 
differently,
consider the code:

public class Lambdas1 {
     public static void main(String[]args) {
         Runnable r3 = () -> {
             Runnable r4 = () ->System.out.println(new Exception().getStackTrace()[0]);
             r4.run();
             System.out.println(new Exception().getStackTrace()[0]);
         };
         r3.run();
     }
}

with jdk 23 the output is:
Lambdas1.lambda$main$*0*(Lambdas1.java:7)
Lambdas1.lambda$main$*1*(Lambdas1.java:9)

with jdk 24:
Lambdas1.lambda$main$*1*(Lambdas1.java:4)
Lambdas1.lambda$main$*0*(Lambdas1.java:6)

I know that this is not specified anywhere, but Intellij IDEA relied on 
this and it caused issues with debugger features:
https://youtrack.jetbrains.com/issue/IDEA-375811

Was this change really intended? Could anyone please point me to the fix 
that caused this?

Thanks!
Egor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/compiler-dev/attachments/20250711/e5888526/attachment.htm>


More information about the compiler-dev mailing list