JDK-6213818 : crash: java.lang.NullPointerException at com.sun.tools.javac.code.Types$SubstFcn.subst(Types.java:20
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 5.0,6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-01-04
  • Updated: 2010-04-02
  • Resolved: 2006-01-07
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.
JDK 6
6 b67Fixed
Related Reports
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.6.0-ea"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-ea-b16)
Java HotSpot(TM) Client VM (build 1.6.0-ea-b16, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
compiler crash instead of sensible message,

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
see below under "Source-Code"

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
compiler crash instead of sensible message
ACTUAL -
see "Error Messages"

ERROR MESSAGES/STACK TRACES THAT OCCUR :
C:\Daten\arbeit6\g2_repro>C:\Programme\java\jdk1.6.0\bin\javac -sourcepath src -d bin -Xlint:unchecked src\BasicNode.java
An exception has occurred in the compiler (1.6.0-ea). 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.code.Types$SubstFcn.subst(Types.java:2057)
        at com.sun.tools.javac.code.Types.subst(Types.java:2046)
        at com.sun.tools.javac.code.Types.substBound(Types.java:2195)
        at com.sun.tools.javac.comp.Check$Validator.visitTypeApply(Check.java:764)
        at com.sun.tools.javac.tree.Tree$TypeApply.accept(Tree.java:1064)
        at com.sun.tools.javac.comp.Check.validate(Check.java:719)
        at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:2430)
        at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2406)
        at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2355)
        at com.sun.tools.javac.comp.Attr.attribTypeParams(Attr.java:363)
        at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:845)
        at com.sun.tools.javac.code.Symbol.complete(Symbol.java:355)
        at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:614)
        at com.sun.tools.javac.comp.Enter.complete(Enter.java:448)
        at com.sun.tools.javac.main.JavaCompiler.complete(JavaCompiler.java:381)
        at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:1574)
        at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1518)
        at com.sun.tools.javac.code.Symbol.complete(Symbol.java:355)
        at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:614)
        at com.sun.tools.javac.jvm.ClassReader.loadClass(ClassReader.java:1618)
        at com.sun.tools.javac.comp.Resolve.loadClass(Resolve.java:808)
        at com.sun.tools.javac.comp.Resolve.findGlobalType(Resolve.java:867)
        at com.sun.tools.javac.comp.Resolve.findType(Resolve.java:923)
        at com.sun.tools.javac.comp.Resolve.findIdent(Resolve.java:952)
        at com.sun.tools.javac.comp.Resolve.resolveIdent(Resolve.java:1128)
        at com.sun.tools.javac.comp.Attr.visitIdent(Attr.java:1587)
        at com.sun.tools.javac.tree.Tree$Ident.accept(Tree.java:1009)
        at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:280)
        at com.sun.tools.javac.comp.Attr.attribType(Attr.java:308)
        at com.sun.tools.javac.comp.Attr.visitTypeApply(Attr.java:2209)
        at com.sun.tools.javac.tree.Tree$TypeApply.accept(Tree.java:1064)
        at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:280)
        at com.sun.tools.javac.comp.Attr.attribType(Attr.java:308)
        at com.sun.tools.javac.comp.Attr.attribBase(Attr.java:381)
        at com.sun.tools.javac.comp.Attr.visitTypeParameter(Attr.java:2262)
        at com.sun.tools.javac.tree.Tree$TypeParameter.accept(Tree.java:1080)
        at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:280)
        at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:315)
        at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:331)
        at com.sun.tools.javac.comp.Attr.attribTypeParams(Attr.java:356)
        at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:845)
        at com.sun.tools.javac.code.Symbol.complete(Symbol.java:355)
        at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:614)
        at com.sun.tools.javac.comp.Enter.complete(Enter.java:448)
        at com.sun.tools.javac.comp.Enter.main(Enter.java:426)
        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:413)
        at com.sun.tools.javac.main.Main.compile(Main.java:592)
        at com.sun.tools.javac.main.Main.compile(Main.java:544)
        at com.sun.tools.javac.Main.compile(Main.java:67)
        at com.sun.tools.javac.Main.main(Main.java:52)


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
The following 4 classes in corresponding files:

public interface Edge<N extends Node<? extends Edge<N>>> { }

public interface Node<E extends Edge<? extends Node<E>>> { }

class BasicNode<E extends BasicEdge<N, E> & Edge<N>, N extends BasicNode<E, N> & Node<E>> implements Node<E> { }

class BasicEdge<N extends BasicNode<E, N> & Node<E>, E extends BasicEdge<N, E> & Edge<N>> implements Edge<N> { }

compile these classes with:
set JAVA_HOME=C:\Programme\java\jdk1.6.0
set JAVA_COMPILE=%JAVA_HOME%\bin\javac -sourcepath src -d bin -Xlint:unchecked
%JAVA_HOME%\bin\java -version
%JAVA_COMPILE% src\Edge.java
%JAVA_COMPILE% src\Node.java
%JAVA_COMPILE% src\BasicNode.java
pause


---------- END SOURCE ----------
###@###.### 2005-1-04 17:48:36 GMT

Comments
SUGGESTED FIX http://sa.sfbay.sun.com/projects/langtools_data/mustang/6213818/
26-01-2006

SUGGESTED FIX See http://javac.sfbay/reviews/?bugid=6213818 ###@###.### 2005-05-18 02:19:35 GMT
18-05-2005

EVALUATION This is a nastier reincarnation of 4856983. Fortunately, this is a simple change to the fix for 4856983. ###@###.### 2005-1-05 02:18:23 GMT
05-01-2005