groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [2/2] groovy git commit: minor refactor
Date Fri, 29 Sep 2017 12:50:33 GMT
minor refactor


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

Branch: refs/heads/GROOVY_2_5_X
Commit: 4888769de12d760e644c58a79417534fc2362b6f
Parents: f56a9b5
Author: paulk <paulk@asert.com.au>
Authored: Wed Sep 27 22:01:49 2017 +1000
Committer: paulk <paulk@asert.com.au>
Committed: Fri Sep 29 22:50:15 2017 +1000

----------------------------------------------------------------------
 .../codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/4888769d/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java b/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
index aed8f01..f410f71 100644
--- a/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
+++ b/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
@@ -1992,7 +1992,7 @@ public class StaticTypeCheckingVisitor extends ClassCodeVisitorSupport
{
             List<ClassNode> classNodes = getTemporaryTypesForExpression(exp);
             if (classNodes != null && !classNodes.isEmpty()) {
                 ArrayList<ClassNode> arr = new ArrayList<ClassNode>(classNodes.size()
+ 1);
-                if (result != null) arr.add(result);
+                if (result != null && !classNodes.contains(result)) arr.add(result);
                 arr.addAll(classNodes);
                 // GROOVY-7333: filter out Object
                 Iterator<ClassNode> iterator = arr.iterator();


Mime
View raw message