I have a non-trivial source tree that crashes javac with the following stack trace:
The system is out of resources.
Consult the following stack trace for details.
java.lang.StackOverflowError
at com.sun.tools.javac.code.Type$WildcardType.accept(Type.java:415)
at com.sun.tools.javac.code.Types$MapVisitor.visit(Types.java:3214)
at com.sun.tools.javac.code.Types.upperBound(Types.java:95)
at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2968)
at com.sun.tools.javac.code.Types.adapt(Types.java:2998)
at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2959)
at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2968)
at com.sun.tools.javac.code.Types.adapt(Types.java:2998)
at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2959)
at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2968)
at com.sun.tools.javac.code.Types.adapt(Types.java:2998)
at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2959)
at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2968)
at com.sun.tools.javac.code.Types.adapt(Types.java:2998)
at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2959)
at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2968)
at com.sun.tools.javac.code.Types.adapt(Types.java:2998)
at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2959)
at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2968)
at com.sun.tools.javac.code.Types.adapt(Types.java:2998)
at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2959)
at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2968)
This happens with the following java versoin on Linux:
: java -fullversion
java full version "1.6.0_01-b06"
If this can be fixed w/o a test case, that would be wonderful, but otherwise to produce a test case I need to identify which part of the source file is causing this problem. Is there anyway to run javac with some sort of debug flag so that I can figure out which source file is failing to compile? I think that is necessary for me to come up with a smaller test case.
Here's a very small test case:
class A<T extends A<?>> {}
class B extends A<A<?>> {}
class Test {
A<A<?>> t = null;
B c = (B)t;
}