| Other |
|---|
| tbdResolved |
|
Duplicate :
|
|
|
Duplicate :
|
|
|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
Name: js151677 Date: 08/16/2004
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)
======================================================================
|