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

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

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.17, 2.5.8, 3.0.0-rc-1
    • Fix Version/s: 2.5.9, 3.0.0-rc-2
    • Component/s: Compiler
    • Labels:
      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

            People

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

              Dates

              • Created:
                Updated:
                Resolved: