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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • 16
    • 16
    • core-libs
    • None

    Backports

      Description

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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved: