-
Bug
-
Resolution: Fixed
-
P3
-
16
-
None
-
b32
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8259423 | 17 | Rafael Winterhalter | P3 | Resolved | Fixed | b05 |
JDK-8260107 | 16.0.1 | Rafael Winterhalter | P3 | Resolved | Fixed | b03 |
[~winterhalter] found that getAnnotatedReceiver type unnecessarily paramterizes owner types of statically nested classes. This causes issues in ByteBuddy and should be fixed.
The output of the following program shows the issue:
public class Outer<T> {
public static void main(String[] args) throws Exception {
Method method = Inner.class.getMethod("method", Inner.class);
AnnotatedType p = method.getAnnotatedParameterTypes()[0];
AnnotatedType r = method.getAnnotatedReceiverType();
System.out.println(p.getClass());
System.out.println(r.getClass());
}
static class Inner {
public void method(Inner this, Inner argument) { }
}
}
The output of the following program shows the issue:
public class Outer<T> {
public static void main(String[] args) throws Exception {
Method method = Inner.class.getMethod("method", Inner.class);
AnnotatedType p = method.getAnnotatedParameterTypes()[0];
AnnotatedType r = method.getAnnotatedReceiverType();
System.out.println(p.getClass());
System.out.println(r.getClass());
}
static class Inner {
public void method(Inner this, Inner argument) { }
}
}
- backported by
-
JDK-8259423 (ann) getAnnotatedReceiverType should not parameterize owner(s) of statically nested classes
- Resolved
-
JDK-8260107 (ann) getAnnotatedReceiverType should not parameterize owner(s) of statically nested classes
- Resolved
- relates to
-
JDK-8258765 getAnnotatedReceiverType parameterizes types too eagerly
- Resolved