JDK-6982173: Small problem causing thousands of wasted CPU hours
Stuart Marks
stuart.marks at oracle.com
Thu Feb 14 05:07:37 UTC 2019
On 2/13/19 7:22 PM, Alan Snyder wrote:
> If we take this route, how about changing the parameter type to Iterable?
Won't work. Where I've ended up is that we need to iterate over "this"
collection and, for each element, call contains() on the parameter. The
AbstractCollection.removeAll() implementation does something like this:
removeAll(Collection<?> c) {
for (Iterator<?> it = iterator(); it.hasNext();) {
if (c.contains(it.next())) {
it.remove();
}
}
}
Since we call contains() on the parameter, it has to be a Collection.
s'marks
More information about the core-libs-dev
mailing list