void (@NotNull PsiConditionalExpression expression) { super.visitConditionalExpression(expression); final PsiExpression condition = expression.getCondition(); PsiElement last = PsiTreeUtil.getDeepestLast(condition); if (last instanceof PsiWhiteSpace) { last = last.getPrevSibling(); } if (last instanceof PsiErrorElement || expression.getThenExpression() == null) { // can't be fixed return; } PsiElement parent = PsiUtil.skipParenthesizedExprUp(expression.getParent()); if (parent instanceof PsiLocalVariable) { PsiTypeElement typeElement = ((PsiLocalVariable)parent).getTypeElement(); if (typeElement.isInferredType() && !PsiTypesUtil.isDenotableType(typeElement.getType(), typeElement)) { return; } } boolean quickFixOnly = false; if (ignoreSimpleAssignmentsAndReturns) { if (parent instanceof PsiAssignmentExpression || parent instanceof PsiReturnStatement || parent instanceof PsiLocalVariable || parent instanceof PsiLambdaExpression) { quickFixOnly = true; } } final boolean canSurround = !PsiTypes.nullType().equals(expression.getType()) && CodeBlockSurrounder.canSurround(expression); if (!canSurround && (ignoreExpressionContext || !isVisibleHighlight(expression))) { // quick fix is not built in this case (it will break code) and there will be no warning, so just return return; } if (quickFixOnly && !isOnTheFly()) return; registerError(expression, quickFixOnly ? ProblemHighlightType.INFORMATION : ProblemHighlightType.GENERIC_ERROR_OR_WARNING, canSurround); }