]> source.dussan.org Git - aspectj.git/commitdiff
288635: fix
authoraclement <aclement>
Wed, 9 Sep 2009 19:10:33 +0000 (19:10 +0000)
committeraclement <aclement>
Wed, 9 Sep 2009 19:10:33 +0000 (19:10 +0000)
tests/bugs166/pr288635/AddAnnotation.java [new file with mode: 0644]
tests/bugs166/pr288635/Anno.java [new file with mode: 0644]
tests/bugs166/pr288635/InterceptTraceds.java [new file with mode: 0644]
tests/bugs166/pr288635/MakeItd.java [new file with mode: 0644]
tests/bugs166/pr288635/TestClass.java [new file with mode: 0644]
tests/bugs166/pr288635/aop1.xml [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc166/Ajc166Tests.java
tests/src/org/aspectj/systemtest/ajc166/ajc166.xml

diff --git a/tests/bugs166/pr288635/AddAnnotation.java b/tests/bugs166/pr288635/AddAnnotation.java
new file mode 100644 (file)
index 0000000..49e5a58
--- /dev/null
@@ -0,0 +1,3 @@
+public aspect AddAnnotation {
+  declare @method : public int *do*(..) : @Anno;
+}
diff --git a/tests/bugs166/pr288635/Anno.java b/tests/bugs166/pr288635/Anno.java
new file mode 100644 (file)
index 0000000..5bf0224
--- /dev/null
@@ -0,0 +1,9 @@
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Anno {
+  String level() default "debug";
+}
diff --git a/tests/bugs166/pr288635/InterceptTraceds.java b/tests/bugs166/pr288635/InterceptTraceds.java
new file mode 100644 (file)
index 0000000..a33f4ad
--- /dev/null
@@ -0,0 +1,11 @@
+public aspect InterceptTraceds {
+
+       before(Anno t) : execution(@Anno * *.*(..)) && @annotation(t) {
+               if (t != null) {
+                       System.out.println("Executing " + thisJoinPoint + " on level " + t.level());
+               } else {
+                       System.out.println("Annotation was null on " + thisJoinPoint);
+               }
+       }
+       
+}
diff --git a/tests/bugs166/pr288635/MakeItd.java b/tests/bugs166/pr288635/MakeItd.java
new file mode 100644 (file)
index 0000000..50a8cfe
--- /dev/null
@@ -0,0 +1,5 @@
+public aspect MakeItd {
+  public int TestClass.doAnother() {
+    return 2;
+  }
+}
diff --git a/tests/bugs166/pr288635/TestClass.java b/tests/bugs166/pr288635/TestClass.java
new file mode 100644 (file)
index 0000000..e4623c2
--- /dev/null
@@ -0,0 +1,8 @@
+public class TestClass {
+
+       public static void main(String[] args) {
+               TestClass tc = new TestClass();
+               tc.doAnother();
+       }
+       
+}
diff --git a/tests/bugs166/pr288635/aop1.xml b/tests/bugs166/pr288635/aop1.xml
new file mode 100644 (file)
index 0000000..d15cde6
--- /dev/null
@@ -0,0 +1,11 @@
+<aspectj>
+<aspects>
+  <aspect name="AddAnnotation"/>
+  <aspect name="MakeItd"/>
+  <aspect name="InterceptTraceds"/>
+</aspects>
+  <weaver options="-showWeaveInfo -verbose">
+    <dump within="*" beforeandafter="true"/> 
+  </weaver>
+</aspectj>
+
index d497e37f659f8bac00f8576618dac5bdba9926d7..583e7df389927eea1b93eddb6b7f4b7cc885a92b 100644 (file)
@@ -30,6 +30,10 @@ public class Ajc166Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
                runTest("munger cce");
        }
 
+       public void testMungerCCE_288635_2() {
+               runTest("munger cce - 2");
+       }
+
        public void testNPEonBadAspectDecl_286375() {
                runTest("npe on bad aspect decl");
        }
index 0739337899a4e7faed529b8d58482df120aabef6..1e0f7a13181cf3c0efa568993896cc0917928e0a 100644 (file)
     <run class="Main"/>
   </ajc-test>
   
+  <ajc-test dir="bugs166/pr288635" title="munger cce - 2">
+     <compile files="AddAnnotation.java MakeItd.java InterceptTraceds.java TestClass.java Anno.java" options="-1.5 -XterminateAfterCompilation"/>
+     <run class="TestClass" ltw="aop1.xml">
+       <stdout>
+         <line text="Executing execution(int TestClass.doAnother()) on level debug"/>
+       </stdout>
+     </run>
+  </ajc-test>
+  
   <ajc-test dir="bugs166/pr288635" title="munger cce">
      <compile files="org/tests/atann/AddAnnotations.aj org/tests/atann/AddITDDoMethod.aj org/tests/atann/InterceptTraceds.aj org/tests/atann/TestClass.java org/tests/atann/Traced.java" options="-1.5"/>
-     <run class="org.tests.atann.TestClass"/>
+     <run class="org.tests.atann.TestClass">
+       <stdout>
+         <line text="Executing execution(String org.tests.atann.TestClass.doAnnotated()) on level debug"/>
+         <line text="Executing execution(int org.tests.atann.TestClass.doITDAnnotation()) on level debug"/>
+         <line text="Executing execution(int org.tests.atann.TestClass.doAnother()) on level debug"/>
+       </stdout>
+     </run>
   </ajc-test>
    
   <ajc-test dir="bugs166/pr286375" title="npe on bad aspect decl">