Consider this code:
---
public class LambdaWithMethod {
public static void run(Runnable r) {
run(new Runnable() {
public void run() {
put(get());
}
});
}
private static String get() { return null; }
private static void put(String i) {}
}
---
When detecting lambda candidates, this crashes javac:
---
$ javac -XDfind=lambda /tmp/LambdaWithMethod.java
An exception has occurred in the compiler (10-internal). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.AssertionError: Analyzer error when processing: run(new Runnable(){
() {
super();
}
public void run() {
put(get());
}
});
at jdk.compiler/com.sun.tools.javac.util.Assert.error(Assert.java:162)
at jdk.compiler/com.sun.tools.javac.comp.Analyzer.doAnalysis(Analyzer.java:562)
at jdk.compiler/com.sun.tools.javac.comp.Analyzer$2.flush(Analyzer.java:534)
at jdk.compiler/com.sun.tools.javac.comp.Analyzer.flush(Analyzer.java:570)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1398)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1366)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:964)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:306)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:165)
at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57)
at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43)
---
---
public class LambdaWithMethod {
public static void run(Runnable r) {
run(new Runnable() {
public void run() {
put(get());
}
});
}
private static String get() { return null; }
private static void put(String i) {}
}
---
When detecting lambda candidates, this crashes javac:
---
$ javac -XDfind=lambda /tmp/LambdaWithMethod.java
An exception has occurred in the compiler (10-internal). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.AssertionError: Analyzer error when processing: run(new Runnable(){
() {
super();
}
public void run() {
put(get());
}
});
at jdk.compiler/com.sun.tools.javac.util.Assert.error(Assert.java:162)
at jdk.compiler/com.sun.tools.javac.comp.Analyzer.doAnalysis(Analyzer.java:562)
at jdk.compiler/com.sun.tools.javac.comp.Analyzer$2.flush(Analyzer.java:534)
at jdk.compiler/com.sun.tools.javac.comp.Analyzer.flush(Analyzer.java:570)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1398)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1366)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:964)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:306)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:165)
at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57)
at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43)
---