groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject groovy git commit: Minor refactoring
Date Tue, 18 Jul 2017 14:06:12 GMT
Repository: groovy
Updated Branches:
  refs/heads/master e9e4f777b -> d3343303e


Minor refactoring


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/d3343303
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/d3343303
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/d3343303

Branch: refs/heads/master
Commit: d3343303ef2feda4718bf2f4e8621ad57dfaf0bb
Parents: e9e4f77
Author: sunlan <sunlan@apache.org>
Authored: Tue Jul 18 22:05:21 2017 +0800
Committer: sunlan <sunlan@apache.org>
Committed: Tue Jul 18 22:05:54 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/d3343303/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 6dd2efa..4d4d253 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
@@ -2193,7 +2193,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(
@@ -3866,7 +3866,7 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object>
implements Groov
                         VariableExpression.THIS_EXPRESSION,
 
                         (baseExpr instanceof VariableExpression)
-                                ? this.createConstantExpression((VariableExpression) baseExpr)
+                                ? this.createConstantExpression(baseExpr)
                                 : baseExpr,
 
                         arguments
@@ -4033,11 +4033,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
@@ -4070,11 +4067,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) {


Mime
View raw message