private static @Nullable AnalysisStartingPoint fromThrowStatement(PsiThrowStatement throwStatement) {
    PsiElement parent = throwStatement.getParent();
    if (parent instanceof PsiCodeBlock) {
      PsiElement statement = throwStatement.getPrevSibling();
      while (statement != null) {
        statement = statement.getPrevSibling();
        if (statement instanceof PsiIfStatement ifStatement) {
          boolean thenExits = ifStatement.getThenBranch() != null && !ControlFlowUtils.statementMayCompleteNormally(ifStatement.getThenBranch());
          boolean elseExits =
            ifStatement.getElseBranch() != null && !ControlFlowUtils.statementMayCompleteNormally(ifStatement.getElseBranch());
          if (thenExits != elseExits) {
            AnalysisStartingPoint analysis = AnalysisStartingPoint.fromCondition(ifStatement.getCondition());
            return thenExits ? AnalysisStartingPoint.tryNegate(analysis) : analysis;
          }
        }
        if (statement instanceof PsiSwitchLabelStatement) {
          return fromSwitchLabel((PsiSwitchLabelStatement)statement);
        }
      }
      if (parent.getParent() instanceof PsiBlockStatement) {
        parent = parent.getParent().getParent();
      } else {
        return null;
      }
    }
    if (parent instanceof PsiIfStatement && PsiTreeUtil.isAncestor(((PsiIfStatement)parent).getThenBranch(), throwStatement, false)) {
      PsiExpression cond = PsiUtil.skipParenthesizedExprDown(((PsiIfStatement)parent).getCondition());
      return AnalysisStartingPoint.fromCondition(cond);
    }
    if (parent instanceof PsiSwitchLabeledRuleStatement) {
      return fromSwitchLabel((PsiSwitchLabeledRuleStatement)parent);
    }
    return null;
  }
private static @Nullable AnalysisStartingPoint fromThrowStatement(PsiThrowStatement throwStatement)