groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject groovy git commit: GROOVY-8262: GrabAnnotationTransformation.visit has unreachable code
Date Wed, 19 Jul 2017 01:51:01 GMT
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 <paulk@asert.com.au>
Authored: Wed Jul 19 11:49:58 2017 +1000
Committer: paulk <paulk@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) {


Mime
View raw message