boolean (PsiTryStatement statement) { final PsiCatchSection[] sections = statement.getCatchSections(); for (final PsiCatchSection section : sections) { final PsiType catchType = section.getCatchType(); if (catchType != null) { final String typeText = catchType.getCanonicalText(); if ("java.lang.OutOfMemoryError".equals(typeText)) { return true; } } } return false; }