]> source.dussan.org Git - aspectj.git/commitdiff
added a test to make sure primitives work (they do), and also tidied up the array...
authoracolyer <acolyer>
Tue, 25 Oct 2005 04:48:48 +0000 (04:48 +0000)
committeracolyer <acolyer>
Tue, 25 Oct 2005 04:48:48 +0000 (04:48 +0000)
weaver/src/org/aspectj/weaver/reflect/ReflectionWorld.java
weaver/testsrc/org/aspectj/weaver/reflect/ReflectionWorldTest.java

index 789dc580600fb9c818c595c0623a033507168ce5..6ffc84b5155851ddf0c6ee3aafe6499cd9128a8c 100644 (file)
@@ -46,11 +46,12 @@ public class ReflectionWorld extends World {
        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)
index 4bc879daed7d06c6eb2ccc95892819278815ecbc..662d9beb25816506824e86139580d15519ba87f3 100644 (file)
@@ -33,4 +33,10 @@ public class ReflectionWorldTest extends TestCase {
                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));
+       }
+       
 }