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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 16
    • Component/s: core-libs
    • Labels:
      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

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

                  Dates

                  Created:
                  Updated:
                  Resolved: