diff options
Diffstat (limited to 'weaver5')
-rw-r--r-- | weaver5/java5-testsrc/org/aspectj/weaver/TestJava5ReflectionBasedReferenceTypeDelegate.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/weaver5/java5-testsrc/org/aspectj/weaver/TestJava5ReflectionBasedReferenceTypeDelegate.java b/weaver5/java5-testsrc/org/aspectj/weaver/TestJava5ReflectionBasedReferenceTypeDelegate.java index f5061e32b..475c330eb 100644 --- a/weaver5/java5-testsrc/org/aspectj/weaver/TestJava5ReflectionBasedReferenceTypeDelegate.java +++ b/weaver5/java5-testsrc/org/aspectj/weaver/TestJava5ReflectionBasedReferenceTypeDelegate.java @@ -36,10 +36,17 @@ public class TestJava5ReflectionBasedReferenceTypeDelegate extends ReflectionBas UnresolvedType collectionType = UnresolvedType.forName("java.util.Collection"); world.resolve(collectionType).getRawType().resolve(world); ResolvedMember[] methods = world.resolve(collectionType).getDeclaredMethods(); - int i = findMethod("toArray", 1, methods); + int i = -1; + for (int j=0;j<methods.length;j++) { + ResolvedMember method = methods[j]; + if (method.getName().equals("toArray") && method.getParameterSignature().equals("([TT;)")) { + i = j; + } + } assertTrue("Couldn't find 'toArray' in the set of methods? ", i != -1); // String expectedSignature = "java.lang.Object[] java.util.Collection.toArray(java.lang.Object[])"; String expectedSignature = "([Ljava/lang/Object;)[Ljava/lang/Object;"; + assertTrue("Expected signature of '" + expectedSignature + "' but it was '" + methods[i].getSignatureErased(), methods[i] .getSignatureErased().equals(expectedSignature)); } |