Repository: groovy
Updated Branches:
  refs/heads/master 5d5b590cd -> 75a16a0ab


Trivial refactoring: cleanup code


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

Branch: refs/heads/master
Commit: 75a16a0ab9204d44b9e7c0ecc07ad1a9e89333d4
Parents: 5d5b590
Author: danielsun1106 <realblue...@hotmail.com>
Authored: Mon Feb 19 23:23:25 2018 +0800
Committer: danielsun1106 <realblue...@hotmail.com>
Committed: Mon Feb 19 23:23:25 2018 +0800

----------------------------------------------------------------------
 src/main/java/org/codehaus/groovy/ast/expr/EmptyExpression.java | 1 -
 .../java/org/codehaus/groovy/classgen/AnnotationVisitor.java    | 5 -----
 .../codehaus/groovy/classgen/asm/OptimizingStatementWriter.java | 3 +--
 .../groovy/classgen/asm/sc/StaticTypesCallSiteWriter.java       | 1 -
 src/main/java/org/codehaus/groovy/control/ResolveVisitor.java   | 1 -
 .../org/codehaus/groovy/runtime/DefaultGroovyStaticMethods.java | 1 -
 .../transform/AbstractInterruptibleASTTransformation.java       | 2 +-
 src/main/java/org/codehaus/groovy/vmplugin/v7/Selector.java     | 3 +--
 8 files changed, 3 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/75a16a0a/src/main/java/org/codehaus/groovy/ast/expr/EmptyExpression.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/ast/expr/EmptyExpression.java 
b/src/main/java/org/codehaus/groovy/ast/expr/EmptyExpression.java
index 401f906..11ef2d9 100644
--- a/src/main/java/org/codehaus/groovy/ast/expr/EmptyExpression.java
+++ b/src/main/java/org/codehaus/groovy/ast/expr/EmptyExpression.java
@@ -47,7 +47,6 @@ public class EmptyExpression extends Expression {
     }
 
     public void visit(GroovyCodeVisitor visitor) {
-        return;
     }
 
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/75a16a0a/src/main/java/org/codehaus/groovy/classgen/AnnotationVisitor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/AnnotationVisitor.java 
b/src/main/java/org/codehaus/groovy/classgen/AnnotationVisitor.java
index e514b59..dafc741 100644
--- a/src/main/java/org/codehaus/groovy/classgen/AnnotationVisitor.java
+++ b/src/main/java/org/codehaus/groovy/classgen/AnnotationVisitor.java
@@ -240,15 +240,10 @@ public class AnnotationVisitor {
         if (attrType.isArray()) {
             checkReturnType(attrType.getComponentType(), node);
         } else if (ClassHelper.isPrimitiveType(attrType)) {
-            return;
         } else if (ClassHelper.STRING_TYPE.equals(attrType)) {
-            return;
         } else if (ClassHelper.CLASS_Type.equals(attrType)) {
-            return;
         } else if (attrType.isDerivedFrom(ClassHelper.Enum_Type)) {
-            return;
         } else if (isValidAnnotationClass(attrType)) {
-            return;
         } else {
             addError("Unexpected return type " + attrType.getName(), node);
         }

http://git-wip-us.apache.org/repos/asf/groovy/blob/75a16a0a/src/main/java/org/codehaus/groovy/classgen/asm/OptimizingStatementWriter.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/codehaus/groovy/classgen/asm/OptimizingStatementWriter.java 
b/src/main/java/org/codehaus/groovy/classgen/asm/OptimizingStatementWriter.java
index 1539706..fb07f94 100644
--- 
a/src/main/java/org/codehaus/groovy/classgen/asm/OptimizingStatementWriter.java
+++ 
b/src/main/java/org/codehaus/groovy/classgen/asm/OptimizingStatementWriter.java
@@ -335,7 +335,7 @@ public class OptimizingStatementWriter extends 
StatementWriter {
 
     private boolean isNewPathFork(StatementMeta meta) {
         // meta.optimize -> can do fast path
-        if (meta==null || meta.optimize==false) return false;
+        if (meta==null || !meta.optimize) return false;
         // fastPathBlocked -> slow path
         if (fastPathBlocked) return false;
         // controller.isFastPath() -> fastPath
@@ -931,7 +931,6 @@ public class OptimizingStatementWriter extends 
StatementWriter {
 
         @Override
         public void visitClosureExpression(ClosureExpression expression) {
-            return;
         }
 
         @Override

http://git-wip-us.apache.org/repos/asf/groovy/blob/75a16a0a/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticTypesCallSiteWriter.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticTypesCallSiteWriter.java
 
b/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticTypesCallSiteWriter.java
index 28b8aab..f1ff7dd 100644
--- 
a/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticTypesCallSiteWriter.java
+++ 
b/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticTypesCallSiteWriter.java
@@ -498,7 +498,6 @@ public class StaticTypesCallSiteWriter extends 
CallSiteWriter implements Opcodes
         call.setSafe(safe);
         call.setMethodTarget(GROOVYOBJECT_GETPROPERTY_METHOD);
         call.visit(controller.getAcg());
-        return;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/groovy/blob/75a16a0a/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java 
b/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
index 42d9f6f..fe96714 100644
--- a/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
+++ b/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
@@ -1361,7 +1361,6 @@ public class ResolveVisitor extends 
ClassCodeExpressionTransformer {
                     checkCyclicInheritance(originalNode, null, 
intf.getInterfaces());
                 }
             } else {
-                return;
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/groovy/blob/75a16a0a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyStaticMethods.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyStaticMethods.java 
b/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyStaticMethods.java
index 1c85e91..e9ec3c0 100644
--- a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyStaticMethods.java
+++ b/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyStaticMethods.java
@@ -293,7 +293,6 @@ public class DefaultGroovyStaticMethods {
                         throw ioe;
                     }
                 }
-                continue;
             }
         }
         return tempFile;

http://git-wip-us.apache.org/repos/asf/groovy/blob/75a16a0a/src/main/java/org/codehaus/groovy/transform/AbstractInterruptibleASTTransformation.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/codehaus/groovy/transform/AbstractInterruptibleASTTransformation.java
 
b/src/main/java/org/codehaus/groovy/transform/AbstractInterruptibleASTTransformation.java
index f512975..29b5868 100644
--- 
a/src/main/java/org/codehaus/groovy/transform/AbstractInterruptibleASTTransformation.java
+++ 
b/src/main/java/org/codehaus/groovy/transform/AbstractInterruptibleASTTransformation.java
@@ -91,7 +91,7 @@ public abstract class AbstractInterruptibleASTTransformation 
extends ClassCodeVi
     protected void setupTransform(AnnotationNode node) {
         checkOnMethodStart = getBooleanAnnotationParameter(node, 
CHECK_METHOD_START_MEMBER, true);
         applyToAllMembers = getBooleanAnnotationParameter(node, 
APPLY_TO_ALL_MEMBERS, true);
-        applyToAllClasses = applyToAllMembers ? 
getBooleanAnnotationParameter(node, APPLY_TO_ALL_CLASSES, true) : false;
+        applyToAllClasses = applyToAllMembers && 
getBooleanAnnotationParameter(node, APPLY_TO_ALL_CLASSES, true);
         thrownExceptionType = getClassAnnotationParameter(node, 
THROWN_EXCEPTION_TYPE, ClassHelper.make(InterruptedException.class));
     }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/75a16a0a/src/main/java/org/codehaus/groovy/vmplugin/v7/Selector.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/vmplugin/v7/Selector.java 
b/src/main/java/org/codehaus/groovy/vmplugin/v7/Selector.java
index 04d2cdf..6e1c6fe 100644
--- a/src/main/java/org/codehaus/groovy/vmplugin/v7/Selector.java
+++ b/src/main/java/org/codehaus/groovy/vmplugin/v7/Selector.java
@@ -270,7 +270,6 @@ public abstract class Selector {
                 //call asBoolean
                 name = "asBoolean";
                 super.setCallSiteTarget();
-                return;
             }
         }
     }
@@ -851,7 +850,7 @@ public abstract class Selector {
         public void addExceptionHandler() {
             //TODO: if we would know exactly which paths require the exceptions
             //      and which paths not, we can sometimes save this guard 
-            if (handle==null || catchException==false) return;
+            if (handle==null || !catchException) return;
             Class returnType = handle.type().returnType();
             if (returnType!=Object.class) {
                 MethodType mtype = MethodType.methodType(returnType, 
GroovyRuntimeException.class); 

Reply via email to