mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-12 19:06:35 +07:00
additional testdata for inaccessible type params members from IDEA-66305
This commit is contained in:
+24
@@ -15,3 +15,27 @@ abstract class Foo<T extends Foo<T>> {
|
||||
return t.<error descr="'field' has private access in 'Foo'">field</error>;
|
||||
}
|
||||
}
|
||||
|
||||
public class Bug {
|
||||
// Idea incorrectly analyses this code with JDK 7
|
||||
public <T extends Bug> void doit(T other) {
|
||||
// Oops, was legal with JDK 6, no longer legal with JDK 7
|
||||
other.<error descr="'mPrivate()' has private access in 'Bug'">mPrivate</error>();
|
||||
// Redundant with JDK 6, not a redundant cast with JDK 7
|
||||
((Bug)other).mPrivate();
|
||||
}
|
||||
|
||||
// Idea correctly analyses this code
|
||||
public void doit2(SubClass other) {
|
||||
// Not legal with JDK 6 or 7
|
||||
other.<error descr="'mPrivate()' has private access in 'Bug'">mPrivate</error>();
|
||||
// Not redundant with JDK 6 or 7
|
||||
((Bug)other).mPrivate();
|
||||
}
|
||||
|
||||
private void mPrivate() {
|
||||
}
|
||||
}
|
||||
|
||||
class SubClass extends Bug {
|
||||
}
|
||||
+24
@@ -6,4 +6,28 @@ class A {
|
||||
System.out.println(t.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class Bug {
|
||||
// Idea incorrectly analyses this code with JDK 7
|
||||
public <T extends Bug> void doit(T other) {
|
||||
// Oops, was legal with JDK 6, no longer legal with JDK 7
|
||||
other.mPrivate();
|
||||
// Redundant with JDK 6, not a redundant cast with JDK 7
|
||||
((Bug)other).mPrivate();
|
||||
}
|
||||
|
||||
// Idea correctly analyses this code
|
||||
public void doit2(SubClass other) {
|
||||
// Not legal with JDK 6 or 7
|
||||
other.<error descr="'mPrivate()' has private access in 'Bug'">mPrivate</error>();
|
||||
// Not redundant with JDK 6 or 7
|
||||
((Bug)other).mPrivate();
|
||||
}
|
||||
|
||||
private void mPrivate() {
|
||||
}
|
||||
}
|
||||
|
||||
class SubClass extends Bug {
|
||||
}
|
||||
Reference in New Issue
Block a user