< prev index next >
src/java.base/share/classes/java/util/Collections.java
Print this page
rev 54827 : 6394757: AbstractSet.removeAll semantics are surprisingly dependent on relative sizes
Reviewed-by: XXX
*** 1,7 ****
/*
! * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 5377,5395 ****
/**
* Returns {@code true} if the two specified collections have no
* elements in common.
*
! * <p>Care must be exercised if this method is used on collections that
! * do not comply with the general contract for {@code Collection}.
! * Implementations may elect to iterate over either collection and test
! * for containment in the other collection (or to perform any equivalent
! * computation). If either collection uses a nonstandard equality test
! * (as does a {@link SortedSet} whose ordering is not <em>compatible with
! * equals</em>, or the key set of an {@link IdentityHashMap}), both
! * collections must use the same nonstandard equality test, or the
! * result of this method is undefined.
*
* <p>Care must also be exercised when using collections that have
* restrictions on the elements that they may contain. Collection
* implementations are allowed to throw exceptions for any operation
* involving elements they deem ineligible. For absolute safety the
--- 5377,5392 ----
/**
* Returns {@code true} if the two specified collections have no
* elements in common.
*
! * <p>Care must be exercised to ensure that both collections use the
! * same membership semantics. The implementation may elect to iterate
! * over either collection and test element containment in the other
! * collection, or perform any equivalent computation. If the collections
! * use different membership semantics, the result of this method is
! * undefined.
*
* <p>Care must also be exercised when using collections that have
* restrictions on the elements that they may contain. Collection
* implementations are allowed to throw exceptions for any operation
* involving elements they deem ineligible. For absolute safety the
< prev index next >