mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
allow refs to constants from inner classes in explicit constructor invocation: http://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.8.7.1 (IDEA-99980)
This commit is contained in:
@@ -1934,6 +1934,14 @@ public class HighlightUtil extends HighlightUtilBase {
|
||||
|
||||
return highlightInfo;
|
||||
}
|
||||
|
||||
if (element instanceof PsiReferenceExpression) {
|
||||
final PsiElement resolve = ((PsiReferenceExpression)element).resolve();
|
||||
if (resolve instanceof PsiField && ((PsiField)resolve).hasModifierProperty(PsiModifier.STATIC)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
element = element.getParent();
|
||||
if (element instanceof PsiClass && InheritanceUtil.isInheritorOrSelf((PsiClass)element, referencedClass, true)) return null;
|
||||
}
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class Test {
|
||||
public Test() {
|
||||
this(Const.CONST);
|
||||
}
|
||||
|
||||
public Test(int l) {}
|
||||
|
||||
private class Const {
|
||||
private static final int CONST = 42;
|
||||
}
|
||||
}
|
||||
@@ -361,4 +361,5 @@ public class LightAdvHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testThisBeforeSuper() throws Exception { doTest(false, false); }
|
||||
public void testExplicitConstructorInvocation() throws Exception { doTest(false, false); }
|
||||
public void testThisInInterface() throws Exception { doTest(false, false); }
|
||||
public void testInnerClassConstantReference() throws Exception { doTest(false, false); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user