aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2006-08-15 11:51:21 +0000
committeraclement <aclement>2006-08-15 11:51:21 +0000
commit82e3e13c66720ed17399821d478c31151b2d2234 (patch)
tree00c0d8d0ad0472c5f5aeb35670683611fde8558d
parentefb2dd01da7b56b929fdd23c25448ded27182b5e (diff)
downloadaspectj-82e3e13c66720ed17399821d478c31151b2d2234.tar.gz
aspectj-82e3e13c66720ed17399821d478c31151b2d2234.zip
test and fix for 153535
-rw-r--r--weaver/src/org/aspectj/weaver/reflect/ReflectionWorld.java2
-rw-r--r--weaver/testsrc/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java7
-rw-r--r--weaver5/java5-testsrc/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java8
3 files changed, 16 insertions, 1 deletions
diff --git a/weaver/src/org/aspectj/weaver/reflect/ReflectionWorld.java b/weaver/src/org/aspectj/weaver/reflect/ReflectionWorld.java
index a37b46542..96266c23a 100644
--- a/weaver/src/org/aspectj/weaver/reflect/ReflectionWorld.java
+++ b/weaver/src/org/aspectj/weaver/reflect/ReflectionWorld.java
@@ -96,7 +96,7 @@ public class ReflectionWorld extends World implements IReflectionWorld {
// classes that represent arrays return a class name that is the signature of the array type, ho-hum...
String className = aClass.getName();
if (aClass.isArray()) {
- return world.resolve(UnresolvedType.forSignature(className));
+ return world.resolve(UnresolvedType.forSignature(className.replace('.','/')));
}
else{
return world.resolve(className);
diff --git a/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java b/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java
index 0450aedeb..0a844ec5d 100644
--- a/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java
+++ b/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java
@@ -12,6 +12,7 @@
package org.aspectj.weaver.reflect;
+import java.lang.reflect.Method;
import java.util.HashSet;
import java.util.Set;
@@ -99,6 +100,12 @@ public class ReflectionBasedReferenceTypeDelegateTest extends TestCase {
assertEquals(world.resolve("reflect.tests.C"),d.getSuperclass());
}
+ public void testArrayArgsSig() throws Exception {
+ Method invokeMethod = Method.class.getMethod("invoke", new Class[] { Object.class, Object[].class});
+ ResolvedMember reflectionMethod = ReflectionBasedReferenceTypeDelegateFactory.createResolvedMethod(invokeMethod, world);
+ String exp = "(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;";
+ assertTrue("Expected: \n"+exp+"\n but got:\n"+reflectionMethod.getSignature(), reflectionMethod.getSignature().equals(exp));
+ }
protected int findMethod(String name, ResolvedMember[] methods) {
for (int i=0; i<methods.length; i++) {
diff --git a/weaver5/java5-testsrc/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java b/weaver5/java5-testsrc/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java
index f9bef9cc9..4d92b1d6f 100644
--- a/weaver5/java5-testsrc/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java
+++ b/weaver5/java5-testsrc/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java
@@ -12,6 +12,7 @@
package org.aspectj.weaver.reflect;
+import java.lang.reflect.Method;
import java.util.HashSet;
import java.util.Set;
@@ -296,6 +297,13 @@ public abstract class ReflectionBasedReferenceTypeDelegateTest extends TestCase
assertTrue("Should be one extra (clinit) in BCEL case, but bcel="+rms1.length+" reflect="+rms2.length,rms1.length==rms2.length+1);
}
}
+
+ public void testArrayArgsSig() throws Exception {
+ Method invokeMethod = Method.class.getMethod("invoke", new Class[] { Object.class, Object[].class});
+ ResolvedMember reflectionMethod = ReflectionBasedReferenceTypeDelegateFactory.createResolvedMethod(invokeMethod, world);
+ String exp = "(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;";
+ assertTrue("Expected: \n"+exp+"\n but got:\n"+reflectionMethod.getSignature(), reflectionMethod.getSignature().equals(exp));
+ }
// todo: array of int