mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
non-static members access from implicitly static context fixed (IDEA-108285)
This commit is contained in:
+1
-1
@@ -835,7 +835,7 @@ public class HighlightClassUtil {
|
||||
}
|
||||
if (place instanceof PsiModifierListOwner) {
|
||||
final PsiModifierList modifierList = ((PsiModifierListOwner)place).getModifierList();
|
||||
if (modifierList != null && modifierList.hasExplicitModifier(PsiModifier.STATIC)) {
|
||||
if (modifierList != null && modifierList.hasModifierProperty(PsiModifier.STATIC)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -3,12 +3,12 @@ class C implements A {
|
||||
}
|
||||
|
||||
interface A {
|
||||
A a = new C(<error descr="Cannot find symbol variable this">this</error>);
|
||||
A a = new C(<error descr="'A.this' cannot be referenced from a static context">this</error>);
|
||||
A a1 = new C(<error descr="Cannot find symbol variable this">this</error>){};
|
||||
|
||||
class B {
|
||||
A foo() {
|
||||
return <error descr="Cannot find symbol variable this">A.this</error>;
|
||||
return <error descr="'A.this' cannot be referenced from a static context">A.this</error>;
|
||||
}
|
||||
|
||||
B foo1() {
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class Test<T> {
|
||||
interface NestedInterface<U extends <error descr="'Test.this' cannot be referenced from a static context">T</error>> {
|
||||
<V extends <error descr="'Test.this' cannot be referenced from a static context">T</error>> void foo();
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
interface Bazz {
|
||||
Bazz foo = <error descr="Cannot find symbol variable this">Bazz.this</error>;
|
||||
Bazz foo = <error descr="'Bazz.this' cannot be referenced from a static context">Bazz.this</error>;
|
||||
static void foo1() {
|
||||
Bazz foo = <error descr="'Bazz.this' cannot be referenced from a static context">Bazz.this</error>;
|
||||
}
|
||||
@@ -7,7 +7,7 @@ interface Bazz {
|
||||
Runnable bar = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Bazz f = <error descr="Cannot find symbol variable this">Bazz.this</error>;
|
||||
Bazz f = <error descr="'Bazz.this' cannot be referenced from a static context">Bazz.this</error>;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+1
@@ -55,4 +55,5 @@ public class LightAdvHighlightingJdk6Test extends LightDaemonAnalyzerTestCase {
|
||||
public void testJavacQuirks() { setLanguageLevel(LanguageLevel.JDK_1_6); doTest(true, false); }
|
||||
public void testMethodReturnTypeSubstitutability() { setLanguageLevel(LanguageLevel.JDK_1_6); doTest(true, false); }
|
||||
public void testIDEADEV11877() throws Exception { setLanguageLevel(LanguageLevel.JDK_1_6); doTest(false, false); }
|
||||
public void testIDEA108285() throws Exception { setLanguageLevel(LanguageLevel.JDK_1_6); doTest(false, false); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user