JDK-8094099 : antlr throws NPE when building FX
  • Type: Bug
  • Component: javafx
  • Sub-Component: build
  • Affected Version: 8u20
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2014-04-16
  • Updated: 2015-06-12
  • Resolved: 2014-04-16
Related Reports
Duplicate :  
Relates :  
Description
Every time when I start a fresh 8u20-dev build (using jfx+rt+rt-closed repos only), an exception gets thrown. Note that the build continues and completes successfully afterwards. The exception is as follows:

$ JDK_HOME=/d/tools/java/8 gradle
 Defining Closed Properties
:buildSrc:clean UP-TO-DATE
:buildSrc:generateGrammarSourceerror(10):  internal error: Can't get property indirectDelegates using method get/isIndirectDelegates from org.antlr.tool.Grammar instance : java.lang.NullPointerException
java.util.Objects.requireNonNull(Objects.java:203)
java.util.ArrayList.removeAll(ArrayList.java:674)
org.antlr.tool.CompositeGrammar.getIndirectDelegates(CompositeGrammar.java:222)
org.antlr.tool.Grammar.getIndirectDelegates(Grammar.java:2620)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:483)
org.antlr.stringtemplate.language.ASTExpr.invokeMethod(ASTExpr.java:563)
org.antlr.stringtemplate.language.ASTExpr.rawGetObjectProperty(ASTExpr.java:514)
org.antlr.stringtemplate.language.ASTExpr.getObjectProperty(ASTExpr.java:416)
org.antlr.stringtemplate.language.ActionEvaluator.attribute(ActionEvaluator.java:351)
org.antlr.stringtemplate.language.ActionEvaluator.expr(ActionEvaluator.java:136)
org.antlr.stringtemplate.language.ActionEvaluator.templateApplication(ActionEvaluator.java:216)
org.antlr.stringtemplate.language.ActionEvaluator.expr(ActionEvaluator.java:126)
org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:84)
org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:148)
org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:700)
org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:722)
org.antlr.stringtemplate.language.ASTExpr.writeAttribute(ASTExpr.java:659)
org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:86)
org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:148)
org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:700)
org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:722)
org.antlr.stringtemplate.language.ASTExpr.writeAttribute(ASTExpr.java:659)
org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:86)
org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:148)
org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:700)
org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:722)
org.antlr.stringtemplate.language.ASTExpr.writeAttribute(ASTExpr.java:659)
org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:86)
org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:148)
org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:700)
org.antlr.codegen.CodeGenerator.write(CodeGenerator.java:1278)
org.antlr.codegen.Target.genRecognizerFile(Target.java:94)
org.antlr.codegen.CodeGenerator.genRecognizer(CodeGenerator.java:463)
org.antlr.Tool.generateRecognizer(Tool.java:607)
org.antlr.Tool.process(Tool.java:429)
org.antlr.Tool.main(Tool.java:91)

:buildSrc:compileJava

Comments
Thanks!
16-04-2014

I filed RT-36708 to track upgrading antlr.
16-04-2014

Sounds good. Thanks. How can I get notified when the issue is filed?
16-04-2014

There isn't one, but I will file one as an enhancement request for 9. I wouldn't want to do it just to get rid of this NPE, since it is harmless (although having to ignore errors can hide other failures so it would be good to remove the need), but there might be other reasons to upgrade.
16-04-2014

So, what JIRA tracks the antlr update then? I see that all other bugs referenced above are Closed/Fixed, that's why I'm asking.
16-04-2014

Note that we would need a new version of antlr to fix this, since the JDK team decided to keep the change from JDK-4802647 even though the bug fix broke compatibility.
16-04-2014

This is a known antlr bug that was exposed by the fix for https://bugs.openjdk.java.net/browse/JDK-4802647 -- see RT-30955 and the associated JDK bugs in that thread.
16-04-2014

Note that incremental builds don't generate this error.
16-04-2014