-
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
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.