List<PsiType> (Set<? extends PsiClassType> thrownTypes, PsiType caughtType, Set<? super PsiType> caughtTypes) { if (thrownTypes.contains(caughtType)) { caughtTypes.add(caughtType); thrownTypes.remove(caughtType); if (ignoreThrown) { return Collections.emptyList(); } } if (onlyWarnOnRootExceptions) { if (!ExceptionUtils.isGenericExceptionClass(caughtType)) { return Collections.emptyList(); } } final List<PsiType> maskedTypes = new ArrayList<>(); for (PsiType typeThrown : thrownTypes) { if (!caughtTypes.contains(typeThrown) && caughtType.isAssignableFrom(typeThrown)) { caughtTypes.add(typeThrown); maskedTypes.add(typeThrown); } } return maskedTypes; }