boolean (PsiSwitchExpression expression) { Ref<Boolean> ref = Ref.create(); ref.set(false); ControlFlowUtils.processElementsInCurrentScope(expression, element -> { if (element instanceof PsiThrowStatement) { ref.set(true); return false; } return true; }); return ref.get(); }