Set<PsiClassType> (PsiCodeBlock body, PsiMethod method, PsiClass containingClass) { Collection<PsiClassType> types = ExceptionUtil.collectUnhandledExceptions(body, method, false); Set<PsiClassType> unhandled = new HashSet<>(types); if (method.isConstructor()) { // there may be field initializer throwing exception // that exception must be caught in the constructor PsiField[] fields = containingClass.getFields(); for (final PsiField field : fields) { if (field.hasModifierProperty(PsiModifier.STATIC)) continue; PsiExpression initializer = field.getInitializer(); if (initializer == null) continue; unhandled.addAll(ExceptionUtil.collectUnhandledExceptions(initializer, field)); } } return unhandled; }