[jboss-dev-forums] [Design the new POJO MicroContainer] - Bug in Sun compiler?

adrian@jboss.org do-not-reply at jboss.com
Tue Jan 30 09:30:17 EST 2007


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#4008317

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008317



More information about the jboss-dev-forums mailing list