ensure that cast won't be marked as redundant for jdk7 (IDEA-82002)

(is valid though for jdk6)
This commit is contained in:
anna
2012-03-29 20:04:23 +02:00
parent 8c852b28d5
commit 6ea7222b14
4 changed files with 20 additions and 1 deletions
@@ -6,4 +6,12 @@ class A {
System.out.println(t.<error descr="'value' has private access in 'A'">value</error>);
}
}
}
}
abstract class Foo<T extends Foo<T>> {
private int field;
public int bar(T t){
return t.<error descr="'field' has private access in 'Foo'">field</error>;
}
}
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems/>
@@ -0,0 +1,7 @@
public abstract class Foo<T extends Foo<T>> {
private int field;
public int bar(T t){
return ((Foo<T>)t).field;
}
}
@@ -37,6 +37,8 @@ public class RedundantCast15Test extends InspectionTestCase {
public void testRawCastsToAvoidIncompatibility() throws Exception { doTest();}
public void testTypeParameterAccessChecksJava7() throws Exception { doTest();}
public void testIgnore() throws Exception {
final RedundantCastInspection castInspection = new RedundantCastInspection();
castInspection.IGNORE_ANNOTATED_METHODS = true;