mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-242390 - small fixes in the implementation, moved tests
GitOrigin-RevId: a6ecea269e96abe30b06f032353159431b589421
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8eaa9d4c52
commit
82ae7a22a6
+3
-2
@@ -2288,9 +2288,10 @@ public final class HighlightUtil {
|
||||
PsiExpression qualifierExpr = expression.getQualifierExpression();
|
||||
// simple reference can be illegal (JLS 8.3.3)
|
||||
if (qualifierExpr == null) return false;
|
||||
if (!(qualifierExpr instanceof PsiReferenceExpression)) return true;
|
||||
|
||||
PsiReference qualifiedReference = qualifierExpr.getReference();
|
||||
if (qualifiedReference != null && containingClass.equals(qualifiedReference.resolve())) {
|
||||
PsiElement qualifiedReference = ((PsiReferenceExpression)qualifierExpr).resolve();
|
||||
if (qualifiedReference != null && containingClass.equals(qualifiedReference)) {
|
||||
// static fields that are constant variables (4.12.4) are initialized before other static fields (12.4.2),
|
||||
// so a qualified reference to the constant variable is possible.
|
||||
return PsiUtil.isCompileTimeConstant(referencedField);
|
||||
|
||||
-2
@@ -61,7 +61,6 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
private void doTest7(boolean checkWarnings) { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, checkWarnings); }
|
||||
private void doTest7Incompatibility() { doTest(LanguageLevel.JDK_1_5, JavaSdkVersion.JDK_1_7, false); }
|
||||
private void doTest8Incompatibility(boolean checkWarnings) { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_8, checkWarnings); }
|
||||
private void doTest15(boolean checkWarnings) {doTest(LanguageLevel.JDK_15, JavaSdkVersion.JDK_15, checkWarnings);}
|
||||
|
||||
public void testReferenceTypeParams() { doTest5(false); }
|
||||
public void testOverridingMethods() { doTest5(false); }
|
||||
@@ -86,7 +85,6 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testEnum() { doTest5(false); }
|
||||
public void testEnum56239() { doTest6(false); }
|
||||
public void testEnum242390() { doTest7(false); }
|
||||
public void testEnum242390_15() { doTest15(false); }
|
||||
public void testSameErasure() { doTest5(false); }
|
||||
public void testPairsWithSameErasure() { doTest5(false); }
|
||||
public void testMethods() { doTest5(false); }
|
||||
|
||||
+2
@@ -25,6 +25,8 @@ public class LightLocalEnumsInterfacesHighlightingTest extends LightJavaCodeInsi
|
||||
public void testLocalEnum() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testLocalEnumForwardReference() { doTest(); }
|
||||
|
||||
private void doTest() {
|
||||
myFixture.configureByFile(getTestName(false) + ".java");
|
||||
|
||||
Reference in New Issue
Block a user