Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8259224

(ann) getAnnotatedReceiverType should not parameterize owner(s) of statically nested classes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 16
    • 16
    • core-libs
    • None

        [~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) { }
              }
          }

              winterhalter Rafael Winterhalter
              jfranck Joel Borggrén-Franck (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: