/** * Returns a <code>ThrowableSet</code> which contains all the exceptions from the current set except for those in the given * <code>ThrowableSet</code>. * * @param s * The set containing the exceptions to exclude from the new set * * @return The exceptions that are only in this set, but not in the given set * * @throws ThrowableSet.AlreadyHasExclusionsException * if this <code>ThrowableSet</code> or <code>s</code> is the result of a {@link #whichCatchableAs(RefType)} * operation, so that it is not possible to represent the addition of <code>s</code> to this * <code>ThrowableSet</code>. */ public ThrowableSet remove(ThrowableSet s) { if ((exceptionsExcluded.size() > 0) || (s.exceptionsExcluded.size() > 0)) { throw new AlreadyHasExclusionsException( "ThrowableSet.Add(ThrowableSet): attempt to add to [" + this.toString() + "] after removals recorded."); } // Remove the exceptions return this.remove(s.exceptionsIncluded); }
for (Trap t : trapsForUnit) { Pair p = curStmtSet.whichCatchableAs(t.getException().getType()); curStmtSet = curStmtSet.remove(p.getCaught());