diff --git a/tool/src/org/antlr/v4/tool/Grammar.java b/tool/src/org/antlr/v4/tool/Grammar.java index 5b943db8c..d94d405a7 100644 --- a/tool/src/org/antlr/v4/tool/Grammar.java +++ b/tool/src/org/antlr/v4/tool/Grammar.java @@ -758,7 +758,7 @@ public class Grammar implements AttributeResolver { Map lexerRuleToStringLiteral = new HashMap(); List ruleNodes = ast.getNodesWithType(ANTLRParser.RULE); - if ( ruleNodes==null || ruleNodes.size()==0 ) return null; + if ( ruleNodes==null || ruleNodes.isEmpty() ) return null; for (GrammarAST r : ruleNodes) { //tool.log("grammar", r.toStringTree()); @@ -782,7 +782,7 @@ public class Grammar implements AttributeResolver { TreeWizard wiz, Map lexerRuleToStringLiteral) { - HashMap nodes = new HashMap(); + HashMap nodes = new HashMap(); if ( wiz.parse(r, pattern, nodes) ) { GrammarAST litNode = (GrammarAST)nodes.get("lit"); GrammarAST nameNode = (GrammarAST)nodes.get("name");