]> source.dussan.org Git - aspectj.git/commitdiff
322272: declare annotation for incremental compilation when used through abstract...
authoraclement <aclement>
Tue, 10 Aug 2010 23:48:19 +0000 (23:48 +0000)
committeraclement <aclement>
Tue, 10 Aug 2010 23:48:19 +0000 (23:48 +0000)
tests/bugs1610/pr322272/Base.java [new file with mode: 0644]
tests/bugs1610/pr322272/Base2.java [new file with mode: 0644]
tests/bugs1610/pr322272/F1.java [new file with mode: 0644]
tests/bugs1610/pr322272/F2.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc1610/Ajc1610Tests.java
tests/src/org/aspectj/systemtest/ajc1610/ajc1610.xml

diff --git a/tests/bugs1610/pr322272/Base.java b/tests/bugs1610/pr322272/Base.java
new file mode 100644 (file)
index 0000000..035fa9c
--- /dev/null
@@ -0,0 +1,9 @@
+import java.lang.annotation.*;
+
+public abstract aspect Base {
+  declare @type: F*: @Anno;
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Anno {
+}
diff --git a/tests/bugs1610/pr322272/Base2.java b/tests/bugs1610/pr322272/Base2.java
new file mode 100644 (file)
index 0000000..08131a6
--- /dev/null
@@ -0,0 +1,9 @@
+import java.lang.annotation.*;
+
+public abstract aspect Base2<B> {
+  declare @type: F*: @Anno;
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Anno {
+}
diff --git a/tests/bugs1610/pr322272/F1.java b/tests/bugs1610/pr322272/F1.java
new file mode 100644 (file)
index 0000000..c3df609
--- /dev/null
@@ -0,0 +1,8 @@
+public class F1 {
+  public static void main(String []argv) throws Exception {
+    System.out.println(F1.class.getAnnotations()[0]);
+  }
+}
+
+aspect X extends Base {
+}
diff --git a/tests/bugs1610/pr322272/F2.java b/tests/bugs1610/pr322272/F2.java
new file mode 100644 (file)
index 0000000..c0df2c9
--- /dev/null
@@ -0,0 +1,8 @@
+public class F2 {
+  public static void main(String []argv) throws Exception {
+    System.out.println(F2.class.getAnnotations()[0]);
+  }
+}
+
+aspect X extends Base2<String> {
+}
index 04641aaaf1819ca82999b6c8ba9b23ee5555b093..061be391bed24383a6b8652b505a637ad255af80 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 Contributors 
+ * Copyright (c) 2008 Contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,7 +18,14 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
 
 public class Ajc1610Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 
-       // Interesting new behaviour on AspectJ 1.6.9 - probably due to initial inner type changes.  
+       public void testAbstractAspectAndDeclares_322272_2() {
+               runTest("abstract aspects and declares - 2");
+       }
+
+       public void testAbstractAspectAndDeclares_322272() {
+               runTest("abstract aspects and declares");
+       }
+       // Interesting new behaviour on AspectJ 1.6.9 - probably due to initial inner type changes.
        // Looks a real error (creating two annotations the same on a type is a bad thing)
        //      public void testDuplicateAnnotations() {
        //              runTest("duplicate annotation");
index c51060775efc47477c4b51116232ea9dd85c49e2..44b7c0ebae317ec8845adabcd5fa48681d43dae8 100644 (file)
     </compile>
   </ajc-test>
   
+  <ajc-test dir="bugs1610/pr322272" title="abstract aspects and declares">
+    <compile files="Base.java" outjar="superaspect.jar" options="-1.5"/>
+    <compile files="F1.java" classpath="superaspect.jar" options="-1.5">
+    </compile>
+    <run class="F1">
+    <stdout>
+    <line text="@Anno()"/>
+    </stdout>
+    </run>
+  </ajc-test>
+  
+  <ajc-test dir="bugs1610/pr322272" title="abstract aspects and declares - 2">
+    <compile files="Base2.java" outjar="superaspect.jar" options="-1.5"/>
+    <compile files="F2.java" classpath="superaspect.jar" options="-1.5">
+    </compile>
+    <run class="F2">
+    <stdout>
+    <line text="@Anno()"/>
+    </stdout>
+    </run>
+  </ajc-test>
+  
 </suite>
\ No newline at end of file