[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: ClassCastException for char[] MetaValue creation

scott.stark@jboss.org do-not-reply at jboss.com
Tue Aug 7 16:48:47 EDT 2007


Based on other tests like org.jboss.test.classinfo.test.AbstractClassInfoTest.testArray:

  |    protected void testArray(Class<?> clazz, TypeInfo info) throws Throwable
  |    {
  |       TypeInfo arrayType = info.getArrayType(1);
  |       getLog().debug("ArrayType(1): " + arrayType);
  |       assertTrue(arrayType.isArray());
  |       Class<?> arrayClass = Array.newInstance(clazz, 1).getClass();
  |       assertEquals(arrayClass, arrayType.getType());
  | 
  |       arrayType = info.getArrayType(5);
  |       getLog().debug("ArrayType(5): " + arrayType);
  |       assertTrue(arrayType.isArray());
  |       arrayClass = Array.newInstance(clazz, 5).getClass();
  |       assertEquals(arrayClass, arrayType.getType());
  |    }
  | 

the getArrayType is supposed to return a TypeInfo for a TypeInfo that corresponds to TypeInfo[depth]? I thought this was returning the TypeInfo for the given dimension of the array.

  |    /**
  |     * Whether this type is an array
  |     * 
  |     * @param depth the array depth
  |     * @return the array type
  |     */
  |    TypeInfo getArrayType(int depth);
  | 

This needs to be clarified.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071727#4071727

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



More information about the jboss-dev-forums mailing list