From 1e18562cab585182174d9894f1f2a8528b084b77 Mon Sep 17 00:00:00 2001 From: acolyer Date: Tue, 12 Jul 2005 11:08:09 +0000 Subject: [PATCH] test that a the erasure of a signature matches a parameterized implementation of a method --- .../generics/pointcuts/RawSignatureMatching.aj | 17 +++++++++++++++++ .../systemtest/ajc150/GenericsTests.java | 4 ++++ .../org/aspectj/systemtest/ajc150/ajc150.xml | 6 ++++++ 3 files changed, 27 insertions(+) create mode 100644 tests/java5/generics/pointcuts/RawSignatureMatching.aj 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 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 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 @@ + + + + + + -- 2.39.5