static HighlightInfo.Builder checkUnreachableStatement(@Nullable PsiCodeBlock codeBlock) {
    if (codeBlock == null) return null;
    // do not compute constant expressions for if() statement condition
    // see JLS 14.20 Unreachable Statements
    try {
      AllVariablesControlFlowPolicy policy = AllVariablesControlFlowPolicy.getInstance();
      ControlFlow controlFlow = ControlFlowFactory.getControlFlow(codeBlock, policy, ControlFlowOptions.NO_CONST_EVALUATE);
      PsiElement unreachableStatement = ControlFlowUtil.getUnreachableStatement(controlFlow);
      if (unreachableStatement != null) {
        if (unreachableStatement instanceof PsiCodeBlock && unreachableStatement.getParent() instanceof PsiBlockStatement) {
          unreachableStatement = unreachableStatement.getParent();
        }
        if (unreachableStatement instanceof PsiStatement) {
          PsiElement parent = unreachableStatement.getParent();
          if (parent instanceof PsiWhileStatement || parent instanceof PsiForStatement) {
            PsiExpression condition = ((PsiConditionalLoopStatement)parent).getCondition();
            if (Boolean.FALSE.equals(ExpressionUtils.computeConstantExpression(condition))) {
              HighlightInfo.Builder info = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(condition)
                .descriptionAndTooltip(JavaErrorBundle.message("unreachable.statement.false.condition"));
              IntentionAction action = getQuickFixFactory().createSimplifyBooleanFix(condition, false);
              info.registerFix(action, null, null, null, null);
              return info;
            }
          }
        }
        String description = JavaErrorBundle.message("unreachable.statement");
        PsiElement keyword = null;
        if (unreachableStatement instanceof PsiIfStatement ||
            unreachableStatement instanceof PsiSwitchBlock ||
            unreachableStatement instanceof PsiLoopStatement ||
            unreachableStatement instanceof PsiThrowStatement ||
            unreachableStatement instanceof PsiReturnStatement ||
            unreachableStatement instanceof PsiYieldStatement ||
            unreachableStatement instanceof PsiTryStatement ||
            unreachableStatement instanceof PsiSynchronizedStatement ||
            unreachableStatement instanceof PsiAssertStatement ||
            unreachableStatement instanceof PsiLabeledStatement) {
          keyword = unreachableStatement.getFirstChild();
        }
        PsiElement element = keyword != null ? keyword : unreachableStatement;
        HighlightInfo.Builder info =
          HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(element).descriptionAndTooltip(description);
        IntentionAction action =
          getQuickFixFactory().createDeleteFix(unreachableStatement, QuickFixBundle.message("delete.unreachable.statement.fix.text"));
        info.registerFix(action, null, null, null, null);
        return info;
      }
    }
    catch (AnalysisCanceledException | IndexNotReadyException e) {
      // incomplete code
    }
    return null;
  }
static HighlightInfo.Builder checkUnreachableStatement(@Nullable PsiCodeBlock codeBlock)