You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2018/08/11 13:20:19 UTC
groovy git commit: Trivial refactoring: remove unnecessary type check
and cast
Repository: groovy
Updated Branches:
refs/heads/master 47889e8a5 -> bc2d85c62
Trivial refactoring: remove unnecessary type check and cast
Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/bc2d85c6
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/bc2d85c6
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/bc2d85c6
Branch: refs/heads/master
Commit: bc2d85c62710fdf198f5be66cb097067eff5934b
Parents: 47889e8
Author: Daniel Sun <su...@apache.org>
Authored: Sat Aug 11 21:18:16 2018 +0800
Committer: Daniel Sun <su...@apache.org>
Committed: Sat Aug 11 21:19:47 2018 +0800
----------------------------------------------------------------------
src/main/java/org/codehaus/groovy/control/ResolveVisitor.java | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/groovy/blob/bc2d85c6/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 b29754e..f18739a 100644
--- a/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
+++ b/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
@@ -1122,14 +1122,12 @@ public class ResolveVisitor extends ClassCodeExpressionTransformer {
resolveOrFail(t, ce);
visitAnnotations(para);
if (para.hasInitialExpression()) {
- Object initialVal = para.getInitialExpression();
- if (initialVal instanceof Expression) {
- para.setInitialExpression(transform((Expression) initialVal));
- }
+ para.setInitialExpression(transform(para.getInitialExpression()));
}
visitAnnotations(para);
}
}
+
Statement code = ce.getCode();
if (code != null) code.visit(this);
inClosure = oldInClosure;