boolean (@NotNull PsiExpression expression) { if (PsiUtil.isAccessedForWriting(expression)) return false; PsiElement element = PsiUtil.skipParenthesizedExprUp(expression); PsiElement parent = element == null ? null : element.getParent(); if (parent instanceof PsiDoWhileStatement && containsBreakOrContinue((PsiDoWhileStatement)parent)) return false; PsiConditionalExpression parentConditionalExpr = ObjectUtils.tryCast(parent, PsiConditionalExpression.class); if (parentConditionalExpr != null && NullabilityProblemKind.fromContext(parentConditionalExpr, Collections.emptyMap()) != null) { PsiExpression exprToCheck = mySubExpressionValue ? parentConditionalExpr.getThenExpression() : parentConditionalExpr.getElseExpression(); return exprToCheck == null || !TypeConversionUtil.isNullType(exprToCheck.getType()); } return true; }