mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ensure that cast won't be marked as redundant for jdk7 (IDEA-82002)
(is valid though for jdk6)
This commit is contained in:
+9
-1
@@ -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>;
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems/>
|
||||
+7
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user