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

AST for precompiled classes loaded from the classpath does not contain constructor annotation information

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.17, 2.5.8, 3.0.0-rc-1
    • 2.5.9, 3.0.0-rc-2
    • Compiler
    • None

    Description

      It looks like constructor annotation information is not populated in the AST for classes loaded from the classpath in this block of code in org.codehaus.groovy.vmplugin.v5.Java5#configureClassNode: https://github.com/apache/groovy/blob/master/src/main/java/org/codehaus/groovy/vmplugin/v5/Java5.java#L388. What seems to be missing are calls to setAnnotationMetaData() like in the block above for methods.

      I found this bug accidentally when using @InheritConstructors(constructorAnnotations = true)) and not seeing the annotations copied onto inherited constructors in some cases which turned out to be when the superclass of the class annotated with @InheritConstructors is not part of the compiled sources but is loaded from a jar.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            paulk Paul King
            erdi Marcin Erdmann
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment