Eric Milles created GROOVY-8262:
-----------------------------------

             Summary: GrabAnnotationTransformation.visit has unreachable code
                 Key: GROOVY-8262
                 URL: https://issues.apache.org/jira/browse/GROOVY-8262
             Project: Groovy
          Issue Type: Bug
            Reporter: Eric Milles
            Priority: Minor


GrabAnnotationTransformation.visit at about line 260 has an else block that is 
unreachable.  I think the second predicate {{mval == null}} should be removed 
from the if condition.  This should give a more appropriate error message if an 
attribute is given with an empty or null value.

{code}
                            if (member == null || mval == null) {
                                addError("The missing attribute \"" + s + "\" 
is required in @" + node.getClassNode().getNameWithoutPackage() + " 
annotations", node);
                                continue grabResolverAnnotationLoop;
                            } else if (mval == null) {
                                addError("Attribute \"" + s + "\" has value " + 
member.getText() + " but should be an inline constant String in @" + 
node.getClassNode().getNameWithoutPackage() + " annotations", node);
                                continue grabResolverAnnotationLoop;
                            }
{code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to