(reflect) enclosing type parameter missing in anonymous and local classes

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • 5.0
    • Affects Version/s: 5.0
    • Component/s: core-libs

      The following reflection test case fails (t is assigned null):

      import java.lang.reflect.*;

      class A<T> {
          Object o = new Object() {
              public T t;
          };
          public static void main(String[] args) throws NoSuchFieldException {
              Type t = new A<Integer>().o.getClass().getField("t").getGenericType();
              if (!(t instanceof TypeVariable))
                  throw new Error("" + t);
          }
      }

            Assignee:
            Peter Ahe
            Reporter:
            Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: