mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-21 22:11:40 +07:00
error preferences according to javac (IDEA-180509)
This commit is contained in:
@@ -2625,10 +2625,7 @@ public class HighlightUtil extends HighlightUtilBase {
|
||||
PsiElement refName = ref.getReferenceNameElement();
|
||||
if (!(refName instanceof PsiIdentifier) && !(refName instanceof PsiKeyword)) return null;
|
||||
PsiElement resolved = result.getElement();
|
||||
|
||||
HighlightInfo highlightInfo = checkMemberReferencedBeforeConstructorCalled(ref, resolved, containingFile);
|
||||
if (highlightInfo != null) return highlightInfo;
|
||||
|
||||
|
||||
PsiElement refParent = ref.getParent();
|
||||
PsiElement granny;
|
||||
if (refParent instanceof PsiReferenceExpression && (granny = refParent.getParent()) instanceof PsiMethodCallExpression) {
|
||||
|
||||
@@ -1196,6 +1196,8 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
|
||||
|
||||
if (!myHolder.hasErrorResults()) myHolder.add(HighlightUtil.checkPackageAndClassConflict(ref, myFile));
|
||||
if (!myHolder.hasErrorResults() && resolved instanceof PsiClass) myHolder.add(HighlightUtil.checkLegalVarReference(ref, (PsiClass)resolved));
|
||||
if (!myHolder.hasErrorResults()) myHolder.add(HighlightUtil.checkMemberReferencedBeforeConstructorCalled(ref, resolved, myFile));
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
class Test {
|
||||
static class A {
|
||||
private int a;
|
||||
|
||||
A(final int a) {}
|
||||
}
|
||||
|
||||
static class B extends A {
|
||||
B() {
|
||||
super(<error descr="'a' has private access in 'Test.A'">a</error>);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -431,4 +431,5 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testCaptureForBoundCheck() { doTest6(false); }
|
||||
public void testGetClassInAnonymous() { doTest6(false); }
|
||||
public void testInheritFromDifferentParameterizations() { doTest6(false); }
|
||||
public void testCheckAccessibilityBeforeSuperFieldReferenceInSuperCall() { doTest6(false); }
|
||||
}
|
||||
Reference in New Issue
Block a user