boolean (PsiExpression expression) { PsiReferenceExpression ref = tryCast(skipParenthesizedExprDown(expression), PsiReferenceExpression.class); if (ref == null) return false; PsiField target = tryCast(ref.resolve(), PsiField.class); if (target == null) return false; if (target instanceof PsiEnumConstant) return true; if (!(target instanceof PsiFieldImpl)) return false; if (!target.hasModifierProperty(PsiModifier.STATIC) || !target.hasModifierProperty(PsiModifier.FINAL)) return false; PsiExpression initializer = PsiFieldImpl.getDetachedInitializer(target); return ExpressionUtils.isNewObject(initializer); }