groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [3/3] groovy git commit: minor refactor
Date Fri, 29 Sep 2017 13:08:02 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/a8bccc94
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/a8bccc94
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/a8bccc94

Branch: refs/heads/GROOVY_2_4_X
Commit: a8bccc944e7532a7efa694f8b1341bacc6df32cb
Parents: 132f8ca
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 23:05:35 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/a8bccc94/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 f986d1b..5872bb8 100644
--- a/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
+++ b/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
@@ -1966,7 +1966,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