Skip to content

Navigation Menu

Sign in
Sign up

Clarify BloomFilter.put return value under concurrency #8597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
NgoQuocViet2001 wants to merge 1 commit into google:master
base: master
Choose a base branch
Loading
from NgoQuocViet2001:docs-bloomfilter-concurrent-put-contract
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions guava/src/com/google/common/hash/BloomFilter.java
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,13 @@ public boolean test(@ParametricNullness T input) {
* Puts an element into this {@code BloomFilter}. Ensures that subsequent invocations of {@link
* #mightContain(Object)} with the same element will always return {@code true}.
*
* @return true if the Bloom filter's bits changed as a result of this operation. If the bits
* changed, this is <i>definitely</i> the first time {@code object} has been added to the
* filter. If the bits haven't changed, this <i>might</i> be the first time {@code object} has
* been added to the filter. Note that {@code put(t)} always returns the <i>opposite</i>
* result to what {@code mightContain(t)} would have returned at the time it is called.
* @return true if the Bloom filter's bits changed as a result of this operation. In the absence
* of concurrent calls to {@code put}, if the bits changed, this is <i>definitely</i> the first
* time {@code object} has been added to the filter. If the bits haven't changed, this
* <i>might</i> be the first time {@code object} has been added to the filter. Note that, in the
* absence of concurrent calls to {@code put}, {@code put(t)} always returns the
* <i>opposite</i> result to what {@code mightContain(t)} would have returned at the time it is
* called. With concurrent calls, multiple calls may return true for the same object.
* @since 12.0 (present in 11.0 with {@code void} return type})
*/
@CanIgnoreReturnValue
Expand Down

AltStyle によって変換されたページ (->オリジナル) /