public ResolvedType resolve(Class aClass) {
// classes that represent arrays return a class name that is the signature of the array type, ho-hum...
String className = aClass.getName();
- if (!className.startsWith("[")) {
- return resolve(className);
- } else {
+ if (aClass.isArray()) {
return resolve(UnresolvedType.forSignature(className));
}
+ else{
+ return resolve(className);
+ }
}
/* (non-Javadoc)
assertTrue(rt.isArray());
}
+ public void testPrimitiveTypes() {
+ ReflectionWorld world = new ReflectionWorld();
+ assertEquals("int",ResolvedType.INT,world.resolve(int.class));
+ assertEquals("void",ResolvedType.VOID,world.resolve(void.class));
+ }
+
}