]> source.dussan.org Git - aspectj.git/commitdiff
tests for pr73050 :- support for isAnonymous and name pattern matching that now only...
authoracolyer <acolyer>
Fri, 4 Nov 2005 13:13:09 +0000 (13:13 +0000)
committeracolyer <acolyer>
Fri, 4 Nov 2005 13:13:09 +0000 (13:13 +0000)
tests/bugs150/Pr73050.aj [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml

diff --git a/tests/bugs150/Pr73050.aj b/tests/bugs150/Pr73050.aj
new file mode 100644 (file)
index 0000000..ed0168c
--- /dev/null
@@ -0,0 +1,20 @@
+public aspect Pr73050 {
+       
+       pointcut anonymousTypeMatchedByNamePattern() :
+               staticinitialization(Pr73050.*1*);
+       
+       pointcut anonymousTypeMatchedByWildCard() :
+               staticinitialization(Pr73050.*);
+       
+       declare warning : anonymousTypeMatchedByNamePattern() : 
+               "anonymous types shouldn't be matched by name patterns";
+       
+       declare warning : anonymousTypeMatchedByWildCard() :
+               "anonymous types should be matched by a * wild card";
+       
+       public void foo() {
+               (new Runnable() {
+                       public void run() {}
+               }).run();
+       }
+}
\ No newline at end of file
index 26c4d16fcab129d10414c9ff6baf81e8280997ef..daa45d8b346405ba294f28a42b057d57ae3f5b91 100644 (file)
@@ -665,6 +665,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
          runTest("java 5 pointcuts and declares at pre-java 5 compliance levels");
   }
   
+  public void testAnonymousTypes() {
+         runTest("Anonymous types and nome matching");
+  }
+  
   // helper methods.....
   
   public SyntheticRepository createRepos(File cpentry) {
index ee03eea741fb226b900201daf4d70c482d78a3e8..2f43ab7d36df8b374c9d5896e68ab4ce9ad74043 100644 (file)
       </compile>
     </ajc-test>
     
+    <ajc-test dir="bugs150" title="Anonymous types and nome matching">
+      <compile files="Pr73050.aj" outjar="jar1.jar">
+        <message kind="warning" line="16" text="anonymous types should be matched by a * wild card"/>
+      </compile>
+      <compile inpath="jar1.jar">
+        <message kind="warning" line="0" text="anonymous types should be matched by a * wild card"/>     
+      </compile>
+    </ajc-test>
+    
     <ajc-test dir="bugs150/pr86903" title="bcelrenderer bad">
       <compile files="GenericService.java,Service.java,Main.java,BadWormhole.java"/>
       <run class="Main"/>