-
Bug
-
Resolution: Not an Issue
-
P3
-
7, 8, 11, 17, 18
Parameter annotations being copied to inner classes was introduced in JDK-8010737
The behaviour of this cannot be verified using the javap tool.
When running javap on the following example:
@Target(value = {ElementType.PARAMETER})
@interface ParamAnnotation {}
public class initParams {
public initParams(@ParamAnnotation int i) {}
public void m() {
new initParams(2) {};
}
}
Parameter annotations are only visible in the output when using the tool against the parent constructor
Output snippet:
RuntimeInvisibleParameterAnnotations:
0:
0: #12()
When using the tool against the class file generated for the anonymous class, no such Parameter Annotations can be seen in the output
Note: other annotations are not copied either like `constructor` and type annotations
The behaviour of this cannot be verified using the javap tool.
When running javap on the following example:
@Target(value = {ElementType.PARAMETER})
@interface ParamAnnotation {}
public class initParams {
public initParams(@ParamAnnotation int i) {}
public void m() {
new initParams(2) {};
}
}
Parameter annotations are only visible in the output when using the tool against the parent constructor
Output snippet:
RuntimeInvisibleParameterAnnotations:
0:
0: #12()
When using the tool against the class file generated for the anonymous class, no such Parameter Annotations can be seen in the output
Note: other annotations are not copied either like `constructor` and type annotations
- csr for
-
JDK-8277679 annotations in the super class constructor are not propagated to the anonymous class constructor
- Closed
- relates to
-
JDK-8180892 Correct handling of annotations on parameters
- Open
-
JDK-8074977 Constructor.getAnnotatedParameterTypes returns wrong value
- Closed
-
JDK-8010737 javac, known parameter's names should be copied to automatically generated constructors for inner classes
- Closed
-
JDK-6695379 Copy method annotations and parameter annotations to synthetic bridge methods
- Closed
- links to
-
Review openjdk/jdk/6548
(1 links to)