]> source.dussan.org Git - aspectj.git/commitdiff
test for pr104529, @SuppressWarnings("unchecked") not being honored
authoracolyer <acolyer>
Fri, 19 Aug 2005 19:18:31 +0000 (19:18 +0000)
committeracolyer <acolyer>
Fri, 19 Aug 2005 19:18:31 +0000 (19:18 +0000)
tests/bugs150/pr104529.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/pr104529.aj b/tests/bugs150/pr104529.aj
new file mode 100644 (file)
index 0000000..ddec2dc
--- /dev/null
@@ -0,0 +1,19 @@
+import java.util.*;
+public class pr104529 {
+       
+       /*
+        * AJDT is ignoring the @SuppressWarnings( "unchecked" ) annotation.  It is giving 
+     * me a type safety warning when I don't specify the type when declaring a generic 
+     * even though I have the @SuppressWarnings( "unchecked" ) annotation specified.
+        */
+       
+       void unsuppressed() {
+               List<String> l = new ArrayList();
+       }
+       
+       @SuppressWarnings("unchecked")
+       void suppressed() {
+               List<Double> l = new ArrayList();
+       }
+       
+}
index f4ed350fa9072fcc713ad201802f795cd9f369f8..cfd7a5fc3a270a15a425b98566df57a62e662743 100644 (file)
@@ -242,6 +242,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
          runTest("overriding final pointcut from super-aspect");
   }
   
+  public void testAtSuppressWarnings() {
+         runTest("@SuppressWarnings should suppress");
+  }
+  
   // helper methods.....
   
   public SyntheticRepository createRepos(File cpentry) {
index da8d9e661d81765313d0264995b3a48ae226b784..f8e1a2e7aae5699fa4f9b02dfa45531501d5fb73 100644 (file)
          </compile>
     </ajc-test>        
             
+    <ajc-test dir="bugs150" pr="104529" title="@SuppressWarnings should suppress">
+        <compile files="pr104529.aj" options = "-1.5 -warn:+unchecked">
+            <message line="11" kind="warning" text="needs unchecked conversion"/>
+        </compile>
+    </ajc-test>
+            
+            
     <ajc-test dir="bugs150" pr="107059" title="parser crashes on call(void (@a *)(..)">
         <compile files="pr107059.aj">
             <message line="3" kind="error" text="Syntax error on token &quot;(&quot;, &quot;name pattern&quot; expected"/>