]> source.dussan.org Git - aspectj.git/commitdiff
253109: fix
authoraclement <aclement>
Mon, 3 Nov 2008 22:18:40 +0000 (22:18 +0000)
committeraclement <aclement>
Mon, 3 Nov 2008 22:18:40 +0000 (22:18 +0000)
tests/bugs163/pr253109/CodeFour.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java
tests/src/org/aspectj/systemtest/ajc163/ajc163.xml

diff --git a/tests/bugs163/pr253109/CodeFour.java b/tests/bugs163/pr253109/CodeFour.java
new file mode 100644 (file)
index 0000000..729ad88
--- /dev/null
@@ -0,0 +1,13 @@
+import java.util.*;
+
+public aspect CodeFour {
+  
+  static final class FinalSet<T> extends HashSet<T> {}
+
+  before(): execution(* *(..)) && args(List<?>) {}
+  
+  public void m(FinalSet<String> ss) {
+    // List<?> l = (List<?>)ss; // cannot write this (FinalSet is final) so pointcut should not match
+  }
+
+}
index 67ca6e191c770b92a7be451a04788c5ba5a077dc..1e878b8605ed2081f4ac85d8964fc2fafa4b8a82 100644 (file)
    </ajc-test>
 
   <ajc-test dir="java5/generics/pointcuts" title="args with generic wildcard">
-     <compile files="ArgsListOfSomething.aj" options="-1.5">
+     <compile files="ArgsListOfSomething.aj" options="-1.5 -Xlint:ignore">
      </compile>
      <run class="ArgsListOfSomething">
          <stdout>
    
    <ajc-test dir="java5/generics/afterAdvice" title="after returning with generic wildcard">
      <compile files="AfterReturningListOfSomething.aj" options="-1.5">
+       <!-- warning is unchecked match of List<?> from line 28 onto line 15. -->
+       <!-- some sets may be lists unless the set is final, so as a cast is allowed, the match is allowed -->
+       <message kind="warning" line="28"/>
      </compile>
      <run class="AfterReturningListOfSomething">
          <stdout>
index 3641fcd51d5a0d41681a0545f2210f37f886d083..8818ef5d900b3acb84692e88bcd4c529bd9ee737 100644 (file)
@@ -22,7 +22,7 @@ import org.aspectj.testing.Utils;
 import org.aspectj.testing.XMLBasedAjcTestCase;
 
 public class Ajc163Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
-/*
+
        public void testGenericPointcuts_1() {
                runTest("generic pointcuts - 1");
        }
@@ -34,7 +34,11 @@ public class Ajc163Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        public void testGenericPointcuts_3() {
                runTest("generic pointcuts - 3");
        }
-*/
+
+       public void testGenericPointcuts_4() {
+               runTest("generic pointcuts - 4");
+       }
+
        // public void testBrokenLVT_pr194314_1() throws Exception {
        // runTest("broken lvt - 1");
        // JavaClass jc = Utils.getClassFrom(ajc.getSandboxDirectory().getAbsolutePath(), "Service");
index 6fcc6166aaa19eff7837f0363948c5655218303a..af8154154d35a80c4645873d506590f49e916624 100644 (file)
         <message kind="warning" line="9" text="unchecked"/>        
       </compile>
     </ajc-test>
+    
+    <ajc-test dir="bugs163/pr253109" title="generic pointcuts - 4">
+      <compile files="CodeFour.java" options="-1.5">
+        <message kind="warning" text="has not been applied"/>
+      </compile>
+    </ajc-test>
 
     <ajc-test dir="bugs163/pr194314" title="broken lvt - 1">
       <compile files="Service.java IService.java Main.java ServiceInterceptor.java" options="-1.5"/>