Skip to content

Commit

Permalink
describe alternative for unmodifiable/synchronizedNavigableSetNavigab…
Browse files Browse the repository at this point in the history
…leSet for java8 users

Fixes #3283

RELNOTES=n/a
PiperOrigin-RevId: 543436855
  • Loading branch information
kofemann authored and Google Java Core Libraries committed Jun 26, 2023
1 parent 466ad3c commit 01dcc2e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions android/guava/src/com/google/common/collect/Sets.java
Original file line number Diff line number Diff line change
Expand Up @@ -1737,6 +1737,8 @@ static boolean equalsImpl(Set<?> s, @CheckForNull Object object) {
* <p>The returned navigable set will be serializable if the specified navigable set is
* serializable.
*
* <p><b>Java 8 users and later:</b> Prefer {@link Collections#unmodifiableNavigableSet}.
*
* @param set the navigable set for which an unmodifiable view is to be returned
* @return an unmodifiable view of the specified navigable set
* @since 12.0
Expand Down Expand Up @@ -1881,6 +1883,8 @@ public NavigableSet<E> tailSet(@ParametricNullness E fromElement, boolean inclus
* <p>The returned navigable set will be serializable if the specified navigable set is
* serializable.
*
* <p><b>Java 8 users and later:</b> Prefer {@link Collections#synchronizedNavigableSet}.
*
* @param navigableSet the navigable set to be "wrapped" in a synchronized navigable set.
* @return a synchronized view of the specified navigable set.
* @since 13.0
Expand Down
4 changes: 4 additions & 0 deletions guava/src/com/google/common/collect/Sets.java
Original file line number Diff line number Diff line change
Expand Up @@ -1796,6 +1796,8 @@ static boolean equalsImpl(Set<?> s, @CheckForNull Object object) {
* <p>The returned navigable set will be serializable if the specified navigable set is
* serializable.
*
* <p><b>Java 8 users and later:</b> Prefer {@link Collections#unmodifiableNavigableSet}.
*
* @param set the navigable set for which an unmodifiable view is to be returned
* @return an unmodifiable view of the specified navigable set
* @since 12.0
Expand Down Expand Up @@ -1962,6 +1964,8 @@ public NavigableSet<E> tailSet(@ParametricNullness E fromElement, boolean inclus
* <p>The returned navigable set will be serializable if the specified navigable set is
* serializable.
*
* <p><b>Java 8 users and later:</b> Prefer {@link Collections#synchronizedNavigableSet}.
*
* @param navigableSet the navigable set to be "wrapped" in a synchronized navigable set.
* @return a synchronized view of the specified navigable set.
* @since 13.0
Expand Down

0 comments on commit 01dcc2e

Please sign in to comment.