mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
enclosing instance check: don't check the inheritance for the class with extends/implements itself
This commit is contained in:
+1
-1
@@ -784,7 +784,7 @@ public class HighlightClassUtil {
|
||||
if (!PsiUtil.isInnerClass(base)) return;
|
||||
|
||||
if (resolve == resolved && baseClass != null && (!PsiTreeUtil.isAncestor(baseClass, extendRef, true) || aClass.hasModifierProperty(PsiModifier.STATIC)) &&
|
||||
!InheritanceUtil.hasEnclosingInstanceInScope(baseClass, extendRef, PsiUtil.isInnerClass(aClass) && !aClass.hasModifierProperty(PsiModifier.STATIC), true) &&
|
||||
!InheritanceUtil.hasEnclosingInstanceInScope(baseClass, extendRef, psiClass -> psiClass != aClass, true) &&
|
||||
!qualifiedNewCalledInConstructors(aClass)) {
|
||||
String description = JavaErrorMessages.message("no.enclosing.instance.in.scope", HighlightUtil.formatClass(baseClass));
|
||||
infos[0] = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(extendRef).descriptionAndTooltip(description).create();
|
||||
|
||||
Reference in New Issue
Block a user