Repository: groovy Updated Branches: refs/heads/GROOVY_2_6_X 98b4e57d9 -> f0d835bb6
Minor refactoring (cherry picked from commit d334330) Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/f0d835bb Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/f0d835bb Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/f0d835bb Branch: refs/heads/GROOVY_2_6_X Commit: f0d835bb64730f2c770886f143d10c4a2c33bddb Parents: 98b4e57 Author: sunlan <[email protected]> Authored: Tue Jul 18 22:05:21 2017 +0800 Committer: sunlan <[email protected]> Committed: Tue Jul 18 22:09:18 2017 +0800 ---------------------------------------------------------------------- .../org/apache/groovy/parser/antlr4/AstBuilder.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/f0d835bb/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java index 064afc5..3709576 100644 --- a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java +++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java @@ -2210,7 +2210,7 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov VariableExpression.THIS_EXPRESSION, (baseExpr instanceof VariableExpression) - ? this.createConstantExpression((VariableExpression) baseExpr) + ? this.createConstantExpression(baseExpr) : baseExpr, this.configureAST( @@ -3948,7 +3948,7 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov VariableExpression.THIS_EXPRESSION, (baseExpr instanceof VariableExpression) - ? this.createConstantExpression((VariableExpression) baseExpr) + ? this.createConstantExpression(baseExpr) : baseExpr, arguments @@ -4108,11 +4108,8 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov return true; } - if (isAnonymousInnerEnumDeclaration) { - return true; - } + return isAnonymousInnerEnumDeclaration; - return false; } // the mixins of interface and annotation should be null @@ -4145,11 +4142,8 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov private boolean isPackageInfoDeclaration() { String name = this.sourceUnit.getName(); - if (null != name && name.endsWith(PACKAGE_INFO_FILE_NAME)) { - return true; - } + return null != name && name.endsWith(PACKAGE_INFO_FILE_NAME); - return false; } private boolean isBlankScript(CompilationUnitContext ctx) {
