| JDK 19 |
|---|
| 19Resolved |
|
CSR :
|
|
|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
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
|