void (@NotNull PsiReferenceExpression expression) { super.visitReferenceExpression(expression); final PsiElement referent = expression.resolve(); if (!(referent instanceof PsiField field)) { return; } if (!field.hasModifierProperty(PsiModifier.STATIC)) { return; } if (field.hasModifierProperty(PsiModifier.FINAL)) { return; } if (!isInClassInitialization(expression)) { return; } registerError(expression, field); }