groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject groovy git commit: Trivial refactoring: remove redundant variable declaration
Date Thu, 05 Jul 2018 05:56:18 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_5_X abaf687d6 -> 5aecfefe5


Trivial refactoring: remove redundant variable declaration

(cherry picked from commit beea69d)


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

Branch: refs/heads/GROOVY_2_5_X
Commit: 5aecfefe51d26bbe26d8894c9272e7ed5880def7
Parents: abaf687
Author: sunlan <sunlan@apache.org>
Authored: Thu Jul 5 12:41:46 2018 +0800
Committer: sunlan <sunlan@apache.org>
Committed: Thu Jul 5 13:56:13 2018 +0800

----------------------------------------------------------------------
 .../java/org/codehaus/groovy/control/ResolveVisitor.java     | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/5aecfefe/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 90dc125..6087cd4 100644
--- a/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
+++ b/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
@@ -738,9 +738,9 @@ public class ResolveVisitor extends ClassCodeExpressionTransformer {
         }
 
         if (currentClass.getModule().hasPackageName() && name.indexOf('.') == -1)
return false;
-        LookupResult lr = null;
-        lr = classNodeResolver.resolveName(name, compilationUnit);
-        if (lr!=null) {
+
+        LookupResult lr = classNodeResolver.resolveName(name, compilationUnit);
+        if (lr != null) {
             if (lr.isSourceUnit()) {
                 SourceUnit su = lr.getSourceUnit();
                 currentClass.getCompileUnit().addClassNodeToCompile(type, su);
@@ -755,7 +755,7 @@ public class ResolveVisitor extends ClassCodeExpressionTransformer {
 
     public Expression transform(Expression exp) {
         if (exp == null) return null;
-        Expression ret = null;
+        Expression ret;
         if (exp instanceof VariableExpression) {
             ret = transformVariableExpression((VariableExpression) exp);
         } else if (exp.getClass() == PropertyExpression.class) {


Mime
View raw message