-
Bug
-
Resolution: Duplicate
-
P3
-
6
-
x86
-
windows_xp
FULL PRODUCT VERSION :
build 1.5.0-beta2-b51
ADDITIONAL OS VERSION INFORMATION :
Windows XP
A DESCRIPTION OF THE PROBLEM :
Constructor.getGenericParameterTypes for a nested class fail with a parameterized type.
The number of parameters is wrong (The first is missing).
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
ConstructorBugTest$Nested(ConstructorBugTest,java.util.List,long)
class ConstructorBugTest class java.lang.Class
java.util.List<java.lang.String> class sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl
long class java.lang.Class
ACTUAL -
ConstructorBugTest$Nested(ConstructorBugTest,java.util.List,long)
java.util.List<java.lang.String> class sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl
long class java.lang.Class
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.lang.reflect.*;
import java.util.*;
public class ConstructorBugTest {
public static void main(String... args){
Class c = Nested.class;
Constructor[] constructors = c.getDeclaredConstructors();
for(Constructor cons : constructors){
System.out.println(cons);
Type[] types = cons.getGenericParameterTypes();
for(Type t : types){
System.out.println("\t" + t + " " + t.getClass());
}
}
}
private class Nested{
Nested(List list, int x){
}
Nested(List<String> list, long x){
}
}
}
---------- END SOURCE ----------
(Incident Review ID: 297027)
======================================================================
- duplicates
-
JDK-8039918 Constructor.getGenericParameterTypes() with wrong number of parameters
- Closed
-
JDK-8292275 javac does not emit SYNTHETIC and MANDATED flags for parameters by default
- Resolved
- relates to
-
JDK-8004729 Add java.lang.reflect.Parameter and related changes for parameter reflection
- Closed
-
JDK-8292275 javac does not emit SYNTHETIC and MANDATED flags for parameters by default
- Resolved
-
JDK-6520205 (enum) Enum constructor has wrong generic parameter types
- Closed
-
JDK-8180892 Correct handling of annotations on parameters
- Open
-
JDK-8303112 For classes declared in instance methods, constructor.getParameterAnnotations does not include implicit enclosing param
- Open
-
JDK-8055063 Parameter#toString() fails w/ AIOOBE for ctr of inner class w/ generic type
- Resolved