groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwagenleit...@apache.org
Subject groovy git commit: GROOVY-8166: Repeated operations in AnnotationCollectorTransform and Traits (closes #543)
Date Sat, 20 May 2017 13:54:56 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_5_X 4dac373f2 -> 343ff0cdf


GROOVY-8166: Repeated operations in AnnotationCollectorTransform and Traits (closes #543)


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

Branch: refs/heads/GROOVY_2_5_X
Commit: 343ff0cdf3bf20f8526c59617e60a192977b920f
Parents: 4dac373
Author: John Wagenleitner <jwagenleitner@apache.org>
Authored: Sat May 20 06:45:54 2017 -0700
Committer: John Wagenleitner <jwagenleitner@apache.org>
Committed: Sat May 20 06:54:14 2017 -0700

----------------------------------------------------------------------
 .../codehaus/groovy/transform/AnnotationCollectorTransform.java  | 1 -
 src/main/org/codehaus/groovy/transform/trait/Traits.java         | 4 +---
 2 files changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/343ff0cd/src/main/org/codehaus/groovy/transform/AnnotationCollectorTransform.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/transform/AnnotationCollectorTransform.java b/src/main/org/codehaus/groovy/transform/AnnotationCollectorTransform.java
index 80188d9..cf153f7 100644
--- a/src/main/org/codehaus/groovy/transform/AnnotationCollectorTransform.java
+++ b/src/main/org/codehaus/groovy/transform/AnnotationCollectorTransform.java
@@ -268,7 +268,6 @@ public class AnnotationCollectorTransform {
                 generated.put(name, makeExpression(val));
             }
             copyMembers(generated, toAdd);
-            toAdd.getMembers().putAll(generated);
         }
         return ret;
     }

http://git-wip-us.apache.org/repos/asf/groovy/blob/343ff0cd/src/main/org/codehaus/groovy/transform/trait/Traits.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/transform/trait/Traits.java b/src/main/org/codehaus/groovy/transform/trait/Traits.java
index b1c9537..508af26 100644
--- a/src/main/org/codehaus/groovy/transform/trait/Traits.java
+++ b/src/main/org/codehaus/groovy/transform/trait/Traits.java
@@ -155,9 +155,7 @@ public abstract class Traits {
      * @return true if the classnode represents a trait
      */
     public static boolean isTrait(final ClassNode cNode) {
-        return cNode!=null
-                && ((cNode.isInterface() && !cNode.getAnnotations(TRAIT_CLASSNODE).isEmpty())
-                    || isAnnotatedWithTrait(cNode));
+        return cNode != null && isAnnotatedWithTrait(cNode);
     }
 
     /**


Mime
View raw message