PsiExpression (PsiExpression expression) { while (true) { if (expression instanceof PsiParenthesizedExpression) { expression = ((PsiParenthesizedExpression)expression).getExpression(); } else if (expression instanceof PsiTypeCastExpression && !(expression.getType() instanceof PsiPrimitiveType)) { expression = ((PsiTypeCastExpression)expression).getOperand(); } else { return expression; } } }