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:50 GMT
Repository: groovy
Updated Branches:
  refs/heads/master d3343303e -> 4788991f8


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/4788991f
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/4788991f
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/4788991f

Branch: refs/heads/master
Commit: 4788991f8cbfcb2ea7056f9b235149ac5875fd76
Parents: d334330
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:51:38 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/4788991f/src/main/groovy/grape/GrabAnnotationTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/grape/GrabAnnotationTransformation.java b/src/main/groovy/grape/GrabAnnotationTransformation.java
index 16f3b47..e0b501f 100644
--- a/src/main/groovy/grape/GrabAnnotationTransformation.java
+++ b/src/main/groovy/grape/GrabAnnotationTransformation.java
@@ -256,9 +256,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