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

GrabAnnotationTransformation.visit has unreachable code

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.4.13
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: