diff options
author | acolyer <acolyer> | 2005-07-12 11:08:09 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-07-12 11:08:09 +0000 |
commit | 1e18562cab585182174d9894f1f2a8528b084b77 (patch) | |
tree | 68077ec9b34ea22eefd9d23f3ae663ffe853bb4b /tests | |
parent | 178760115e55305fd8f726d078ea162df1ff0399 (diff) | |
download | aspectj-1e18562cab585182174d9894f1f2a8528b084b77.tar.gz aspectj-1e18562cab585182174d9894f1f2a8528b084b77.zip |
test that a the erasure of a signature matches a parameterized implementation of a method
Diffstat (limited to 'tests')
-rw-r--r-- | tests/java5/generics/pointcuts/RawSignatureMatching.aj | 17 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java | 4 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 6 |
3 files changed, 27 insertions, 0 deletions
diff --git a/tests/java5/generics/pointcuts/RawSignatureMatching.aj b/tests/java5/generics/pointcuts/RawSignatureMatching.aj new file mode 100644 index 000000000..cd2640c74 --- /dev/null +++ b/tests/java5/generics/pointcuts/RawSignatureMatching.aj @@ -0,0 +1,17 @@ +public aspect RawSignatureMatching { + + // tests that references to a generic or parameterized type are + // always matched by a type pattern refering to the raw type form + + void someCode() { + ConcreteImplementingClass cic = new ConcreteImplementingClass(); + cic.asInt(5.0d); + GenericImplementingClass<Long> gic = new GenericImplementingClass<Long>(); + 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 fffb6c9b4..02a493639 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java @@ -184,6 +184,10 @@ public class GenericsTests extends XMLBasedAjcTestCase { runTest("execution pcd with raw type matching"); } + public void testExecutionWithRawSignature() { + runTest("execution pcd with raw signature matching"); + } + // --- 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 fe5f9f564..71593277b 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -2472,6 +2472,12 @@ </compile> </ajc-test> + <ajc-test dir="java5/generics/pointcuts" title="execution pcd with raw signature matching"> + <compile files="GenericInterface.java,ConcreteImplementingClass.java,GenericImplementingClass.java,RawSignatureMatching.aj" options="-1.5"> + <message kind="warning" line="4" text="execution(* GenericInterface.asInt(Number))"/> + <message kind="warning" line="5" text="execution(* GenericInterface.asInt(Number))"/> + </compile> + </ajc-test> <!-- end of generics and pointcuts tests --> <!-- ============================================================== --> |