boolean (PsiStatement statement) { if (statement == null) { return false; } if (statement instanceof PsiBreakStatement || statement instanceof PsiContinueStatement || statement instanceof PsiAssertStatement || statement instanceof PsiReturnStatement || statement instanceof PsiExpressionStatement || statement instanceof PsiExpressionListStatement || statement instanceof PsiForeachStatement || statement instanceof PsiDeclarationStatement || statement instanceof PsiEmptyStatement || statement instanceof PsiSwitchLabelStatement) { return false; } else if (statement instanceof PsiThrowStatement) { return true; } else if (statement instanceof PsiForStatement) { return forStatementThrowsException((PsiForStatement)statement); } else if (statement instanceof PsiWhileStatement) { return whileStatementThrowsException((PsiWhileStatement)statement); } else if (statement instanceof PsiDoWhileStatement) { return doWhileThrowsException((PsiDoWhileStatement)statement); } else if (statement instanceof PsiSynchronizedStatement synchronizedStatement) { final PsiCodeBlock body = synchronizedStatement.getBody(); return blockThrowsException(body); } else if (statement instanceof PsiBlockStatement blockStatement) { final PsiCodeBlock codeBlock = blockStatement.getCodeBlock(); return blockThrowsException(codeBlock); } else if (statement instanceof PsiLabeledStatement labeledStatement) { final PsiStatement statementLabeled = labeledStatement.getStatement(); return statementThrowsException(statementLabeled); } else if (statement instanceof PsiIfStatement) { return ifStatementThrowsException((PsiIfStatement)statement); } else if (statement instanceof PsiTryStatement) { return tryStatementThrowsException((PsiTryStatement)statement); } else if (statement instanceof PsiSwitchStatement) { return false; } else { // unknown statement type return false; } }