boolean ( PsiExpression expression) { final PsiClass expressionClass = ClassUtils.getContainingClass(expression); final PsiMember member = PsiTreeUtil.getParentOfType(expression, PsiClassInitializer.class, PsiField.class); if (member == null) { return false; } final PsiClass memberClass = member.getContainingClass(); if (!memberClass.equals(expressionClass)) { return false; } if (!member.hasModifierProperty(PsiModifier.STATIC)) { return false; } if (member instanceof PsiClassInitializer) { return !PsiUtil.isOnAssignmentLeftHand(expression); } return true; }