void (@NotNull PsiClassInitializer initializer) { if (initializer.hasModifierProperty(PsiModifier.STATIC)) return; final PsiCodeBlock body = initializer.getBody(); if (ControlFlowUtils.isEmptyCodeBlock(body)) { return; } final PsiClass containingClass = ClassUtils.getContainingClass(initializer); if (containingClass == null || containingClass instanceof PsiAnonymousClass) { return; } for (Condition<PsiElement> addin : InspectionManager.CANT_BE_STATIC_EXTENSION.getExtensionList()) { if (addin.value(initializer)) return; } final PsiElement scope = containingClass.getScope(); if (!(scope instanceof PsiJavaFile) && !containingClass.hasModifierProperty(PsiModifier.STATIC) && !HighlightingFeature.INNER_STATICS.isAvailable(containingClass)) { return; } if (dependsOnInstanceMembers(initializer)) return; registerClassInitializerError(initializer); }