Skip to content

Instantly share code, notes, and snippets.

@ianopolous
Last active August 16, 2019 09:14
Show Gist options
  • Save ianopolous/5d596696b211d03beef1b8bfdb2dd434 to your computer and use it in GitHub Desktop.
Save ianopolous/5d596696b211d03beef1b8bfdb2dd434 to your computer and use it in GitHub Desktop.
A bug in javac causing compilation failure
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
public class JavacFail {
static final Map<String, String> MAP = new HashMap<>();
static final String HELP = "" + MAP.entrySet().stream()
.map(e -> e.getKey())
.collect(Collectors.joining(""));
}
>> javac -version
javac 1.8.0_222
>> javac JavacFail.java
The system is out of resources.
Consult the following stack trace for details.
java.lang.StackOverflowError
at com.sun.tools.javac.comp.Attr.lambdaEnv(Attr.java:2639)
at com.sun.tools.javac.comp.Attr.visitLambda(Attr.java:2305)
at com.sun.tools.javac.tree.JCTree$JCLambda.accept(JCTree.java:1624)
at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:576)
at com.sun.tools.javac.comp.Attr.visitLambda(Attr.java:2435)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment