]> source.dussan.org Git - aspectj.git/commitdiff
test and fix for 154332: broken java.lang.<annotation> processing
authoraclement <aclement>
Fri, 18 Aug 2006 08:21:58 +0000 (08:21 +0000)
committeraclement <aclement>
Fri, 18 Aug 2006 08:21:58 +0000 (08:21 +0000)
tests/bugs153/pr154332/Annot.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java

diff --git a/tests/bugs153/pr154332/Annot.java b/tests/bugs153/pr154332/Annot.java
new file mode 100644 (file)
index 0000000..183c828
--- /dev/null
@@ -0,0 +1,45 @@
+import java.lang.annotation.*;
+
+@Deprecated @Marker
+
+public aspect Annot {
+
+
+    pointcut test() : within(@Marker *);// *);
+
+   
+
+    declare warning: staticinitialization(@Deprecated *): "deprecated";   
+
+    declare warning: staticinitialization(@Marker *): "marker";   
+
+   
+
+    public static void main(String argz[]) {
+
+        new Baz().foo();
+
+    }
+
+}
+
+
+@Deprecated @Marker
+
+class Baz {
+
+    public void foo() {}
+
+}
+
+
+@Retention(RetentionPolicy.RUNTIME)
+
+ @interface Marker {
+
+
+}
\ No newline at end of file
index afae345b96ee50be77455d4920889af5dcdd8299..e2d6256f202b32f25b58e1726db4806a0954fc05 100644 (file)
@@ -27,6 +27,7 @@ public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
   // public void testArgnamesAndJavac_pr148381() { runTest("argNames and javac");}
   // public void testCFlowXMLAspectLTW_pr149096() { runTest("cflow xml concrete aspect"); }
   // public void testAmbiguousBinding_pr121805() { runTest("ambiguous binding");}
+       public void testIncorrectDeprecatedAnnotationProcessing_pr154332() { runTest("incorrect deprecated annotation processing");}
   public void testPipeliningProblemWithAnnotationsDecp_pr153380_1() { runTest("pipelining decps");}
   public void testUnwantedPointcutWarning_pr148219() { runTest("unwanted warning for pointcut");}
   public void testDecpAndCflowadderMungerClash_pr152631() { runTest("decp and cflowadder munger clash");}
index e7c3822840ec17eefc2f1867ff21a0d3e823f20f..1951d4b3ece02447b7130c67471b53c736fc5c7e 100644 (file)
       </compile>
     </ajc-test>
     
+    <ajc-test dir="bugs153/pr154332" title="incorrect deprecated annotation processing">
+      <compile files="Annot.java" options="-1.5">
+        <message kind="warning" line="5" text="marker"/>
+        <message kind="warning" line="31" text="marker"/>
+        <message kind="warning" line="5" text="deprecated"/>
+        <message kind="warning" line="31" text="deprecated"/>
+      </compile>
+    </ajc-test>
+    
     <ajc-test dir="bugs153/pr148381" title="argNames and javac">
       <!--compile files="C.java" options="-1.5"/>
       <compile files="A.java" options="-1.5"/-->
index 36b71ec3060685ad337d9c5f524e6ebfec67e595..6eefa568591be96041eab0cf0701fb69754e156e 100644 (file)
@@ -641,7 +641,7 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
                        annotations     = new AnnotationX[annos.length];
                        for (int i = 0; i < annos.length; i++) {
                                        Annotation annotation = annos[i];
-                                       annotationTypes[i] = w.resolve(UnresolvedType.forName(annotation.getTypeName()));
+                                       annotationTypes[i] = w.resolve(UnresolvedType.forSignature(annotation.getTypeSignature()));
                                        annotations[i]     = new AnnotationX(annotation,w);
                                }
                }