Community
Participate
Working Groups
When compiling the generics branch of GNU Classpath (a free Java class library implementation) ecj dies with a StackOverflow: ---------- 1. ERROR in ..\..\classpath-generics\java\util\EnumMap.java (at line 0) /* EnumMap.java - Map where keys are enum constants ^ Internal compiler error java.lang.StackOverflowError at org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding.erasure(Typ eVariableBinding.java:257) at org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding.erasure(Typ eVariableBinding.java:257) at org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding.erasure(Typ eVariableBinding.java:257) <... hunderds more deleted ...>
A snapshot of the GNU Classpath generics branch (ready to compile) is available here: http://www.frijters.net/bug100128.zip Unzip and compile using: ecj -1.5 -nowarn @src.lst
+1 for RC3 Dani - pls cast a vote. You know how an Error is bad.
+1 to fix this in 3.1 RC3.
Created attachment 23158 [details] Apply patch on CaptureBinding I suspect issue arises due to capture creating a cyclic supertype (which erasure is then falling into), as firstBound isn't protected for cycle detection.
Maxime - pls obtain a simpler testcase reproducing it.
Thanks! The patch seems to work.
Shorter test case: public class X<E> { E[] m; public X() { X<? extends E> x = null; System.out.println(x.m.length); } }
Thanks for confirming. Also note that another issue got addressed within your source lib (see bug 100147).
Thanks Maxime. Added GenericTypeTest#test759. Fixed
Verified using N20050616-0010 + JDT/Core HEAD. The attached project contains 3 compile errors, but no more internal compile errors.
Verified using N20050616-0010 + JDT/Core HEAD