Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda classes can no longer be detected using $$Lambda$ #271

Open
slovdahl opened this issue Dec 13, 2023 · 0 comments
Open

Lambda classes can no longer be detected using $$Lambda$ #271

slovdahl opened this issue Dec 13, 2023 · 0 comments

Comments

@slovdahl
Copy link

slovdahl commented Dec 13, 2023

Lambda classes can no longer be detected using $$Lambda$ on JDK 21: https://bugs.openjdk.org/browse/JDK-8292914

private static final String LAMBDA_CLASS_NAME = "$$Lambda$";

static boolean isLambdaClass(Class<?> cls) {
return cls.getSimpleName().contains(LAMBDA_CLASS_NAME);
}

https://twitter.com/PeterLawrey/status/1734310590552957258

image

$ /usr/lib/jvm/temurin-21-jdk-amd64/bin/jshell 
|  Welcome to JShell -- Version 21.0.1
|  For an introduction type: /help intro

jshell> Function<String, String> foo = input -> input;
foo ==> $Lambda/0x00007fb9a800a200@4fca772d
$ /usr/lib/jvm/temurin-17-jdk-amd64/bin/jshell 
|  Welcome to JShell -- Version 17.0.9
|  For an introduction type: /help intro

jshell> Function<String, String> foo = input -> input;
foo ==> $Lambda$20/0x00007fa3b8009a08@34c45dca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant