when building openjfx8 with jdk8b92 i encountered this error :

Total time: 5.313 secs
:buildSrc:clean
:buildSrc:generateGrammarSource
error(10):  internal error: Can't get property indirectDelegates using
method ge
t/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:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:43)
java.lang.reflect.Method.invoke(Method.java:491)
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(ActionEval
uator.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:generateGrammarSource FAILED


the cause of this error is this new changeset:

4802647: Throw required NPEs from removeAll()/retainAll()

current code assume that collection.removeAll(null) doesn't do anything.
but with this changeset produces NullPointerException that doesn't handled.

following is part of source code org/antlr/tool/CompositeGrammar.java
(see********
)

  217           /** Get delegates below direct delegates of g */
  218           public List<Grammar> getIndirectDelegates(Grammar g) {
  219                   List<Grammar> direct = getDirectDelegates(g);
  220                   List<Grammar> delegates = getDelegates(g);  221
                delegates.removeAll(direct);********
  222                   return delegates;
  223           }
  224
  225           /** Return list of delegate grammars from root down to g.
  226            *  Order is root, ..., g.parent.  (g not included).
  227            */
  228           public List<Grammar> getDelegators(Grammar g) {
  229                   if ( g==delegateGrammarTreeRoot.grammar ) {
  230                           return null;**********  231             }
  232                   List<Grammar> grammars = new ArrayList();
  233                   CompositeGrammarTree t = 
delegateGrammarTreeRoot.findNode(g);
  234                   // walk backwards to root, collecting grammars
  235                   CompositeGrammarTree p = t.parent;
  236                   while ( p!=null ) {
  237                           grammars.add(0, p.grammar); // add to head so 
in order later
  238                           p = p.parent;
  239                   }
  240                   return grammars;  241           }


So this changeset at least breaks 'antlr' third-party library and any apps
depends on.

Reply via email to