void (@NotNull PsiMethod method) { super.visitMethod(method); if (method.hasModifierProperty(PsiModifier.STATIC) || method.hasModifierProperty(PsiModifier.ABSTRACT) || method.hasModifierProperty(PsiModifier.SYNCHRONIZED) || method.hasModifierProperty(PsiModifier.NATIVE)) { return; } if (method.isConstructor() || method.getNameIdentifier() == null) { return; } if (m_ignoreDefaultMethods && method.hasModifierProperty(PsiModifier.DEFAULT)) { return; } if (m_ignoreEmptyMethods && MethodUtils.isEmpty(method)) { return; } final PsiClass containingClass = ClassUtils.getContainingClass(method); if (containingClass == null) { return; } for (Condition<PsiElement> addin : InspectionManager.CANT_BE_STATIC_EXTENSION.getExtensionList()) { if (addin.value(method)) return; } final PsiElement scope = containingClass.getScope(); if (!(scope instanceof PsiJavaFile) && !containingClass.hasModifierProperty(PsiModifier.STATIC) && !containingClass.isInterface() && !HighlightingFeature.INNER_STATICS.isAvailable(scope)) { return; } if (m_onlyPrivateOrFinal && !method.hasModifierProperty(PsiModifier.FINAL) && !method.hasModifierProperty(PsiModifier.PRIVATE)) { return; } if (isExcluded(method) || MethodUtils.hasSuper(method) || MethodUtils.isOverridden(method)) { return; } if (FindSuperElementsHelper.getSiblingInheritedViaSubClass(method) != null) { return; } final MethodReferenceVisitor visitor = new MethodReferenceVisitor(method); method.accept(visitor); if (!visitor.areReferencesStaticallyAccessible()) { return; } registerMethodError(method); }