-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P2
-
Affects Version/s: 5.0
-
Component/s: core-libs
-
b58
-
generic
-
solaris_8
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);
}
}
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);
}
}
- relates to
-
JDK-5065057 (reflect) Class.getEnclosingMethod unclear spec for local and anon class in ctor
-
- Closed
-