From 96654531b7fdcb09a7ad9e4c324105334e5b9d2c Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Fri, 13 Jul 2012 14:33:42 -0500 Subject: [PATCH] Use isEmpty() instead of size()==0, specify generic arguments --- tool/src/org/antlr/v4/tool/Grammar.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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");