void (@NotNull PsiTypeCastExpression expression) { PsiExpression operand = expression.getOperand(); if (operand == null) { myIsConstant = false; return; } operand.accept(this); if (!myIsConstant) return; PsiTypeElement element = expression.getCastType(); if (element == null) { myIsConstant = false; return; } PsiType type = element.getType(); if (type instanceof PsiPrimitiveType) return; if (type.equalsToText(CommonClassNames.JAVA_LANG_STRING)) return; myIsConstant = false; }