]> source.dussan.org Git - aspectj.git/commitdiff
test that a the erasure of a signature matches a parameterized implementation of...
authoracolyer <acolyer>
Tue, 12 Jul 2005 11:08:09 +0000 (11:08 +0000)
committeracolyer <acolyer>
Tue, 12 Jul 2005 11:08:09 +0000 (11:08 +0000)
tests/java5/generics/pointcuts/RawSignatureMatching.aj [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml

diff --git a/tests/java5/generics/pointcuts/RawSignatureMatching.aj b/tests/java5/generics/pointcuts/RawSignatureMatching.aj
new file mode 100644 (file)
index 0000000..cd2640c
--- /dev/null
@@ -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
index fffb6c9b432002e897f547fff25d38876277bbe2..02a4936398c5b42ad41825c6eb0c06874a57db64 100644 (file)
@@ -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
index fe5f9f5645607b8cbb578547c9516d3d0cd39273..71593277b8dc55b9451f3073b587be0bacb5f629 100644 (file)
      </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 -->
    
    <!-- ============================================================== -->