void (@NotNull PsiField field) { if (!field.hasModifierProperty(PsiModifier.STATIC) || field.hasModifierProperty(PsiModifier.FINAL)) { return; } if (field.getInitializer() != null) { return; } final PsiClass containingClass = field.getContainingClass(); if (containingClass == null || containingClass.isEnum()) { return; } if (m_ignorePrimitives) { final PsiType type = field.getType(); if (ClassUtils.isPrimitive(type)) { return; } } final PsiClassInitializer[] initializers = containingClass.getInitializers(); for (final PsiClassInitializer initializer : initializers) { if (!initializer.hasModifierProperty(PsiModifier.STATIC)) { continue; } final PsiCodeBlock body = initializer.getBody(); if (InitializationUtils.blockAssignsVariableOrFails(body, field)) { return; } } registerFieldError(field); }