diff options
author | acolyer <acolyer> | 2006-05-31 17:32:36 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2006-05-31 17:32:36 +0000 |
commit | 97cd71ae811def2ee79d34567f60acb9f76ebf0c (patch) | |
tree | e984f23113da43804c3a514473472d5a7d346e5e /weaver5 | |
parent | d072fd16eccdca9df642585297804902f68e16cc (diff) | |
download | aspectj-97cd71ae811def2ee79d34567f60acb9f76ebf0c.tar.gz aspectj-97cd71ae811def2ee79d34567f60acb9f76ebf0c.zip |
test and fix for pr144717 - array type as pointcut parameter in reflective world
Diffstat (limited to 'weaver5')
-rw-r--r-- | weaver5/java5-src/org/aspectj/weaver/reflect/Java15ReflectionBasedReferenceTypeDelegate.java | 2 | ||||
-rw-r--r-- | weaver5/java5-testsrc/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/weaver5/java5-src/org/aspectj/weaver/reflect/Java15ReflectionBasedReferenceTypeDelegate.java b/weaver5/java5-src/org/aspectj/weaver/reflect/Java15ReflectionBasedReferenceTypeDelegate.java index 08044ea5b..b6156fc5c 100644 --- a/weaver5/java5-src/org/aspectj/weaver/reflect/Java15ReflectionBasedReferenceTypeDelegate.java +++ b/weaver5/java5-src/org/aspectj/weaver/reflect/Java15ReflectionBasedReferenceTypeDelegate.java @@ -257,7 +257,7 @@ public class Java15ReflectionBasedReferenceTypeDelegate extends AjType<?>[] ptypes = pcs[i].getParameterTypes(); UnresolvedType[] weaverPTypes = new UnresolvedType[ptypes.length]; for (int j = 0; j < weaverPTypes.length; j++) { - weaverPTypes[j] = UnresolvedType.forName(ptypes[j].getName()); + weaverPTypes[j] = this.typeConverter.fromType(ptypes[j].getJavaClass()) ; } pointcuts[i] = new DeferredResolvedPointcutDefinition(getResolvedTypeX(),pcs[i].getModifiers(),pcs[i].getName(),weaverPTypes); } diff --git a/weaver5/java5-testsrc/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java b/weaver5/java5-testsrc/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java index 6e05580b9..4a0ecb28a 100644 --- a/weaver5/java5-testsrc/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java +++ b/weaver5/java5-testsrc/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java @@ -14,6 +14,7 @@ package org.aspectj.weaver.tools; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.reflect.Method; +import java.util.Date; import java.util.List; import org.aspectj.lang.annotation.Pointcut; @@ -299,6 +300,14 @@ public class Java15PointcutExpressionTest extends TestCase { assertTrue("does not match",sm.neverMatches()); } + public void testArrayTypeInArgs() throws Exception { + PointcutParameter[] params = new PointcutParameter[3]; + params[0] = parser.createPointcutParameter("d", Date.class); + params[1] = parser.createPointcutParameter("s", String.class); + params[2] = parser.createPointcutParameter("ss", String[].class); + PointcutExpression ex = parser.parsePointcutExpression("org.aspectj.weaver.tools.Java15PointcutExpressionTest.UsesArrays.pc(d,s,ss)",UsesArrays.class,params); + } + protected void setUp() throws Exception { super.setUp(); parser = PointcutParser.getPointcutParserSupportingAllPrimitivesAndUsingSpecifiedClassloaderForResolution(this.getClass().getClassLoader()); @@ -370,6 +379,13 @@ public class Java15PointcutExpressionTest extends TestCase { public void d() {} } + + private static class UsesArrays { + + @Pointcut("execution(* *(..)) && args(d,s,ss)") + public void pc(Date d, String s, String[] ss) {} + + } } |