From: acolyer Date: Tue, 12 Jul 2005 14:23:35 +0000 (+0000) Subject: test that a signature with a generic declaring type does not match on the erasure... X-Git-Tag: PRE_ANDY~17 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=69bfddbefad71e1ca45eba983668a0c066d848ea;p=aspectj.git test that a signature with a generic declaring type does not match on the erasure of the parameter types --- diff --git a/tests/java5/generics/pointcuts/GenericDeclaringTypeWithParameterErasure.aj b/tests/java5/generics/pointcuts/GenericDeclaringTypeWithParameterErasure.aj new file mode 100644 index 000000000..f92853b40 --- /dev/null +++ b/tests/java5/generics/pointcuts/GenericDeclaringTypeWithParameterErasure.aj @@ -0,0 +1,18 @@ +public aspect GenericDeclaringTypeWithParameterErasure { + + // tests that the erasure of parameter types does NOT match a member when + // the declaring type pattern is generic (must use the type variable instead in + // the non-raw [cooked?] world). + + void someCode() { + ConcreteImplementingClass cic = new ConcreteImplementingClass(); + cic.asInt(5.0d); + GenericImplementingClass gic = new GenericImplementingClass(); + gic.asInt(55L); + } + + declare warning : + execution(* GenericInterface.asInt(Number)) : + "execution(* GenericInterface.asInt(Number))"; + +} \ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java b/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java index 02a493639..08eb412ec 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java @@ -188,6 +188,10 @@ public class GenericsTests extends XMLBasedAjcTestCase { runTest("execution pcd with raw signature matching"); } + public void testExecutionWithGenericDeclaringTypeAndErasedParameterTypes() { + runTest("execution pcd with generic declaring type and erased parameter types"); + } + // --- helpers // Check the signature attribute on a class is correct diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index 71593277b..8e98d67b9 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -2472,12 +2472,18 @@ - + + + + + + +