JDK-8078473 : javac diamond finder crashes when used to build java.base module
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2015-04-23
  • Updated: 2019-01-28
  • Resolved: 2015-05-04
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 9
9 b64Fixed
Related Reports
Duplicate :  
Relates :  
Description
When running the command

    make JAVAC_WARNINGS="-XDfind=diamond -Xmaxwarns 1000"  java.base-only

on a JDK 9 forest, while many diamond warnings are printed, in the end javac exits with a stack trace:

...
536 warnings
An exception has occurred in the compiler (1.9.0-internal). 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$Validator.visitSelect(Check.java:1365)
	at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:2069)
	at com.sun.tools.javac.comp.Check$Validator.validateTree(Check.java:1414)
	at com.sun.tools.javac.comp.Check$Validator.visitWildcard(Check.java:1360)
	at com.sun.tools.javac.tree.JCTree$JCWildcard.accept(JCTree.java:2448)
	at com.sun.tools.javac.comp.Check$Validator.validateTree(Check.java:1414)
	at com.sun.tools.javac.comp.Check$Validator.visitTypeApply(Check.java:1335)
	at com.sun.tools.javac.tree.JCTree$JCTypeApply.accept(JCTree.java:2320)
	at com.sun.tools.javac.comp.Check$Validator.validateTree(Check.java:1414)
	at com.sun.tools.javac.comp.Check.validate(Check.java:1285)
	at com.sun.tools.javac.comp.Attr.visitVarDef(Attr.java:1046)
	at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:920)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:570)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:639)
	at com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:911)
	at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:836)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:570)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:639)
	at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:4325)
	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4232)
	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4161)
	at com.sun.tools.javac.comp.Attr.visitClassDef(Attr.java:862)
	at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:744)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:570)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:639)
	at com.sun.tools.javac.comp.Attr.visitAnonymousClassDefinition(Attr.java:2197)
	at com.sun.tools.javac.comp.Attr.visitNewClass(Attr.java:2097)
	at com.sun.tools.javac.tree.JCTree$JCNewClass.accept(JCTree.java:1653)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:570)
	at com.sun.tools.javac.comp.Attr.visitReturn(Attr.java:1677)
	at com.sun.tools.javac.tree.JCTree$JCReturn.accept(JCTree.java:1510)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:570)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:639)
	at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:658)
	at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1114)
	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:984)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:570)
	at com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:410)
	at com.sun.tools.javac.comp.Analyzer.analyze(Analyzer.java:356)
	at com.sun.tools.javac.comp.Analyzer.analyzeIfNeeded(Analyzer.java:336)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:641)
	at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:658)
	at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1114)
	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:984)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:570)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:639)
	at com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:1005)
	at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:836)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:570)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:639)
	at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:4325)
	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4232)
	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4161)
	at com.sun.tools.javac.comp.Attr.attrib(Attr.java:4136)
	at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1223)
	at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:865)
	at com.sun.tools.javac.main.Main.compile(Main.java:253)
	at com.sun.tools.javac.main.Main.compile(Main.java:141)
	at com.sun.tools.javac.Main.compile(Main.java:56)
	at com.sun.tools.javac.Main.main(Main.java:42)

Comments
URL: http://hg.openjdk.java.net/jdk9/jdk9/langtools/rev/520635aae9e1 User: lana Date: 2015-05-13 21:19:31 +0000
13-05-2015

URL: http://hg.openjdk.java.net/jdk9/dev/langtools/rev/520635aae9e1 User: jlahoda Date: 2015-05-04 09:44:21 +0000
04-05-2015

This is a dormant bug in the pre-existing code that is brought to the fore by the recent work on <> with anonymous classes. Basically, for an unbounded wildcard, there is a difference in how the tree looks when constructed by the parser and by code that uses the TreeMaker to synthesize tree nodes (say to put together a default constructor). When the tree is put together by the parser JCWildcard#inner is null, when it put together by the tree maker it is not null (at the moment). This discrepancy leads to trouble down the line. Fix is to ensure uniformity.
27-04-2015