boolean (@NotNull PsiClass aClass, @NotNull PsiMethod method, @NotNull PsiClass superClass) { if (aClass.hasModifierProperty(PsiModifier.ABSTRACT) || !aClass.isInheritor(superClass, true)) { return true; } final PsiMethod overridingMethod = findOverridingMethod(aClass, method, superClass); if (overridingMethod == null || overridingMethod.hasModifierProperty(PsiModifier.STATIC)) { return false; } if (!method.hasModifierProperty(PsiModifier.PACKAGE_LOCAL)) { return true; } final PsiManager manager = overridingMethod.getManager(); final JavaPsiFacade facade = JavaPsiFacade.getInstance(manager.getProject()); return facade.arePackagesTheSame(superClass, aClass); }