I found this while looking at a microcontainer test.
It fails in both JDK5 and JDK6, but works with eclipse.
Looks like a bug to me? Anybody confirm?
| package test;
|
| import java.lang.reflect.Constructor;
| import java.lang.reflect.Type;
| import java.util.Arrays;
|
| public class Main
| {
| public static void main(String[] args) throws Exception
| {
| Class<MyEnum> clazz = MyEnum.class;
| Constructor<MyEnum> constructor = clazz.getDeclaredConstructor(new Class[]
{ String.class, Integer.TYPE });
| Type[] types = constructor.getParameterTypes();
| Type[] generic = constructor.getGenericParameterTypes();
| System.out.println("types = " + Arrays.asList(types));
| System.out.println("generic = " + Arrays.asList(generic));
| if (Arrays.equals(types, generic) == false)
| throw new RuntimeException("They should be the same?");
| }
|
| public enum MyEnum { ONE, TWO, THREE };
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008317#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...