public static boolean statementMayReturnBeforeRecursing(
      @Nullable GrStatement statement, GrMethod method) {
    if (statement == null) {
      return true;
    }
    if (statement instanceof GrBreakStatement ||
        statement instanceof GrContinueStatement ||
        statement instanceof GrThrowStatement ||
        statement instanceof GrExpression ||
        statement instanceof GrAssertStatement ||
        statement instanceof GrVariableDeclaration) {
      return false;
    } else if (statement instanceof GrReturnStatement returnStatement) {
      final GrExpression returnValue = returnStatement.getReturnValue();
      if (returnValue != null) {
        if (expressionDefinitelyRecurses(returnValue, method)) {
          return false;
        }
      }
      return true;
    } else if (statement instanceof GrForStatement) {
      return forStatementMayReturnBeforeRecursing(
          (GrForStatement) statement, method);
    } else if (statement instanceof GrWhileStatement) {
      return whileStatementMayReturnBeforeRecursing(
          (GrWhileStatement) statement, method);
    } else if (statement instanceof GrSynchronizedStatement) {
      final GrCodeBlock body = ((GrSynchronizedStatement) statement)
          .getBody();
      return codeBlockMayReturnBeforeRecursing(body, method, false);
    } else if (statement instanceof GrBlockStatement blockStatement) {
      final GrCodeBlock codeBlock = blockStatement.getBlock();
      return codeBlockMayReturnBeforeRecursing(codeBlock, method, false);
    } else if (statement instanceof GrIfStatement) {
      return ifStatementMayReturnBeforeRecursing(
          (GrIfStatement) statement, method);
    } else if (statement instanceof GrTryCatchStatement) {
      return tryStatementMayReturnBeforeRecursing(
          (GrTryCatchStatement) statement, method);
    } else if (statement instanceof GrSwitchStatement) {
      return switchStatementMayReturnBeforeRecursing(
          (GrSwitchStatement) statement, method);
    } else {
      // unknown statement type
      return true;
    }
  }
public static boolean statementMayReturnBeforeRecursing(
      @Nullable GrStatement statement, GrMethod method)