You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2017/07/19 01:51:01 UTC

groovy git commit: GROOVY-8262: GrabAnnotationTransformation.visit has unreachable code

Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_4_X 9601fdaea -> 3b20e1135


GROOVY-8262: GrabAnnotationTransformation.visit has unreachable code


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

Branch: refs/heads/GROOVY_2_4_X
Commit: 3b20e11351dd5dd8131fbeb74f413c70a72acdfe
Parents: 9601fda
Author: paulk <pa...@asert.com.au>
Authored: Wed Jul 19 11:49:58 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Wed Jul 19 11:49:58 2017 +1000

----------------------------------------------------------------------
 src/main/groovy/grape/GrabAnnotationTransformation.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/3b20e113/src/main/groovy/grape/GrabAnnotationTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/grape/GrabAnnotationTransformation.java b/src/main/groovy/grape/GrabAnnotationTransformation.java
index f239917..3937e60 100644
--- a/src/main/groovy/grape/GrabAnnotationTransformation.java
+++ b/src/main/groovy/grape/GrabAnnotationTransformation.java
@@ -257,9 +257,8 @@ public class GrabAnnotationTransformation extends ClassCodeVisitorSupport implem
                     } else {
                         for (String s : GRABRESOLVER_REQUIRED) {
                             String mval = getMemberStringValue(node, s);
-                            if (mval != null && mval.isEmpty()) mval = null;
                             Expression member = node.getMember(s);
-                            if (member == null || mval == null) {
+                            if (member == null || (mval != null && mval.isEmpty())) {
                                 addError("The missing attribute \"" + s + "\" is required in @" + node.getClassNode().getNameWithoutPackage() + " annotations", node);
                                 continue grabResolverAnnotationLoop;
                             } else if (mval == null) {