Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-8262

GrabAnnotationTransformation.visit has unreachable code

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4.13
    • Component/s: None
    • Labels:
      None

      Description

      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.

                                  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;
                                  }
      

        Attachments

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              emilles Eric Milles
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: