JDK-6404691 : Complicated Generic types crash the compiler
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2006-03-27
  • Updated: 2010-04-02
  • Resolved: 2006-10-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other JDK 6 Other
5.0,OpenJDK6Resolved 6u1Resolved OpenJDK6Resolved
Related Reports
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.6.0-beta2"
Java(TM) SE Runtime Environment (build 1.6.0-beta2-b76)
Java HotSpot(TM) Client VM (build 1.6.0-beta2-b76, mixed mode, sharing)


ADDITIONAL OS VERSION INFORMATION :
emanuel@emanuel3 ~ $ uname -a
Linux emanuel3.emanuelgreisen.dk 2.6.15-gentoo-r1 #1 PREEMPT Mon Feb 6 17:00:54 CET 2006 i686 Intel(R) Pentium(R) M processor 1.86GHz GenuineIntel GNU/Linux


A DESCRIPTION OF THE PROBLEM :
When I try to compile some Java-files with complicated generics then doing it in the wrong order makes Javac crash.

REGRESSION.  Last worked in version mustang

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Download my testcase: http://emanuelgreisen.dk/stuff/src_0013.tgz

Then from the "src" folder run the bash-script "test.sh" This will crash javac. Note that if you run it a couple of times it eventually compiles everything.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Compilation of all JAVA files.
ACTUAL -
Javac crashes

ERROR MESSAGES/STACK TRACES THAT OCCUR :
javac ./net/gamalocus/cotwl2/data/game/BaseMessage.java
An exception has occurred in the compiler (1.6.0-beta2). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
java.lang.NullPointerException
        at com.sun.tools.javac.comp.Check.checkCompatibleConcretes(Check.java:1225)
        at com.sun.tools.javac.comp.Check.checkCompatibleSupertypes(Check.java:1577)
        at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:2567)
        at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2521)
        at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2457)
        at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:903)
        at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:879)
        at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:663)
        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:635)
        at com.sun.tools.javac.main.Main.compile(Main.java:766)
        at com.sun.tools.javac.main.Main.compile(Main.java:691)
        at com.sun.tools.javac.main.Main.compile(Main.java:680)
        at com.sun.tools.javac.Main.compile(Main.java:70)
        at com.sun.tools.javac.Main.main(Main.java:55)


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
It's too compilated to paste everything here.
http://emanuelgreisen.dk/stuff/src_0013.tgz
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Compile, compile, compile. But this is really sad, since this error is also present in the new JAvaCompilerTool.

Comments
EVALUATION I'm not able find a Mustang build in which this actually compiles. It doesn't work in JDK 5.0 either: this is not a regression.
26-04-2006

EVALUATION This is related to 6218229, however this is a more complicated case which isn't addressed by that fix.
23-04-2006

SUGGESTED FIX .
22-04-2006