AbstractCollection.removeAll(Collection) and AbstractSet.removeAll(Collection)

Mike Duigou mike.duigou at oracle.com
Wed Jul 13 22:42:22 UTC 2011


On Jul 13 2011, at 15:19 , Jason Mehrens wrote:

> worst case AbstractCollection.isEmpty could be O(N).
> JDKs 5 and 6 shipped with two collections (CHM views) that had O(N) isEmpty methods.  

This is very interesting. The common wisdom has been that size() should be avoided because of O(>1) concerns but that isEmpty() is "safe". My assumptions are now amended. :-)

Mike


More information about the core-libs-dev mailing list