aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-10-25 04:48:48 +0000
committeracolyer <acolyer>2005-10-25 04:48:48 +0000
commitbd951ed3eaf19b17ac1b1541d6072246a21a2ca8 (patch)
treeffa1ea5c54941f91c19431ae16a655326c72ae56 /weaver
parent17d987fec6ed69281e8427b60c5cb4d9cd305b0f (diff)
downloadaspectj-bd951ed3eaf19b17ac1b1541d6072246a21a2ca8.tar.gz
aspectj-bd951ed3eaf19b17ac1b1541d6072246a21a2ca8.zip
added a test to make sure primitives work (they do), and also tidied up the array test in ReflectionWorld
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/reflect/ReflectionWorld.java7
-rw-r--r--weaver/testsrc/org/aspectj/weaver/reflect/ReflectionWorldTest.java6
2 files changed, 10 insertions, 3 deletions
diff --git a/weaver/src/org/aspectj/weaver/reflect/ReflectionWorld.java b/weaver/src/org/aspectj/weaver/reflect/ReflectionWorld.java
index 789dc5806..6ffc84b51 100644
--- a/weaver/src/org/aspectj/weaver/reflect/ReflectionWorld.java
+++ b/weaver/src/org/aspectj/weaver/reflect/ReflectionWorld.java
@@ -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)
diff --git a/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionWorldTest.java b/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionWorldTest.java
index 4bc879dae..662d9beb2 100644
--- a/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionWorldTest.java
+++ b/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionWorldTest.java
@@ -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));
+ }
+
}