mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
good code red: allow containing this before super call (IDEA-67756)
This commit is contained in:
@@ -1819,13 +1819,13 @@ public class HighlightUtil {
|
||||
type = ((PsiReferenceExpression)qualifier).getType();
|
||||
referencedClass = PsiUtil.resolveClassInType(type);
|
||||
}
|
||||
else if (qualifier instanceof PsiThisExpression || qualifier == null) {
|
||||
@SuppressWarnings({"unchecked"}) PsiMethod parent = PsiTreeUtil.getParentOfType(expression, PsiMethod.class, true, PsiMember.class);
|
||||
resolved = parent;
|
||||
expression = qualifier == null ? expression : qualifier;
|
||||
else if (qualifier == null) {
|
||||
resolved = PsiTreeUtil.getParentOfType(expression, PsiMethod.class, true, PsiMember.class);
|
||||
if (resolved != null) {
|
||||
referencedClass = ((PsiMethod)resolved).getContainingClass();
|
||||
}
|
||||
} else if (qualifier instanceof PsiThisExpression) {
|
||||
referencedClass = PsiUtil.resolveClassInType(((PsiThisExpression)qualifier).getType());
|
||||
}
|
||||
}
|
||||
if (resolved instanceof PsiField) {
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
class A
|
||||
{
|
||||
class B
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class C extends A
|
||||
{
|
||||
class D extends B
|
||||
{
|
||||
D(){
|
||||
C.this.super();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -357,4 +357,5 @@ public class LightAdvHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testClassicRethrow() throws Exception { doTest(false, false); }
|
||||
public void testRegexp() throws Exception { doTest(false, false); }
|
||||
public void testUnsupportedFeatures() throws Exception { doTest(false, false); }
|
||||
public void testThisBeforeSuper() throws Exception { doTest(false, false); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user