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

(reflect) Generic signature for inner classes crashes runtime

XMLWordPrintable

      The following program crashes the runtime, even after 4979440 is fixed.

      import java.lang.reflect.*;

      class A<T> {
          class B<U> {}
      }

      class Main {
          public void f(A<String>.B<Integer> x) {
          }

          public static void main(String[] args) throws Exception {
              Method m = Main.class.getMethod("f", A.B.class);
              Type param = m.getGenericParameterTypes()[0];
              System.out.println(param.toString());
          }
      }

            darcy Joe Darcy
            gafter Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: