Details
-
Enhancement
-
Resolution: Fixed
-
P4
-
8
-
b94
-
Verified
Description
When generating the method symbol for the anonymous inner class of the example:
@Target(value = {ElementType.PARAMETER})
@interface ParamAnnotation {}
public class initParams {
public initParams(@ParamAnnotation int i) {}
public void m() {
new initParams(2) {};
}
}
Javac will create an int parameter for it, named x0 instead of reusing the more logical "i" in this case.
Also the parameter annotation should be copied to the generated parameter.
@Target(value = {ElementType.PARAMETER})
@interface ParamAnnotation {}
public class initParams {
public initParams(@ParamAnnotation int i) {}
public void m() {
new initParams(2) {};
}
}
Javac will create an int parameter for it, named x0 instead of reusing the more logical "i" in this case.
Also the parameter annotation should be copied to the generated parameter.
Attachments
Issue Links
- relates to
-
JDK-8274617 annotations in the super class constructor are not propagated to the anonymous class constructor
- Resolved
-
JDK-6695379 Copy method annotations and parameter annotations to synthetic bridge methods
- Closed