Browse Source

test for pr104529, @SuppressWarnings("unchecked") not being honored

tags/V1_5_0M3
acolyer 19 years ago
parent
commit
7b32570355

+ 19
- 0
tests/bugs150/pr104529.aj View File

@@ -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();
}
}

+ 4
- 0
tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java View 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) {

+ 7
- 0
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml View File

@@ -91,6 +91,13 @@
</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"/>

Loading…
Cancel
Save