Review for CR 6728865 : Improved heuristics for Collections.disjoint()

Mike Duigou mike.duigou at
Sat Dec 18 00:31:35 UTC 2010

I've posted a webrev for review at

which improves the behaviour of Collections.disjoint() when the collection c1 is not a Set and is larger than c2.

I've included some other micro-optimizations suggested by the issue and by common usage. 

One optimization, the checks whether either collection is empty using isEmpty(), may slightly degrade performance relative to the current implementation but should be a good tradeoff for cases where either of the collections are empty.

I've also upgraded the javadoc to newer style conventions and included the missing @return.

Any comments or feedback welcome.


More information about the core-libs-dev mailing list