Skip to content

Commit 01dcc2e

Browse files
kofemannGoogle Java Core Libraries
authored and
Google Java Core Libraries
committedJun 26, 2023
describe alternative for unmodifiable/synchronizedNavigableSetNavigableSet for java8 users
Fixes #3283 RELNOTES=n/a PiperOrigin-RevId: 543436855
1 parent 466ad3c commit 01dcc2e

File tree

2 files changed

+8
-0
lines changed
  • android/guava/src/com/google/common/collect
  • guava/src/com/google/common/collect

2 files changed

+8
-0
lines changed
 

‎android/guava/src/com/google/common/collect/Sets.java

+4
Original file line numberDiff line numberDiff line change
@@ -1737,6 +1737,8 @@ static boolean equalsImpl(Set<?> s, @CheckForNull Object object) {
17371737
* <p>The returned navigable set will be serializable if the specified navigable set is
17381738
* serializable.
17391739
*
1740+
* <p><b>Java 8 users and later:</b> Prefer {@link Collections#unmodifiableNavigableSet}.
1741+
*
17401742
* @param set the navigable set for which an unmodifiable view is to be returned
17411743
* @return an unmodifiable view of the specified navigable set
17421744
* @since 12.0
@@ -1881,6 +1883,8 @@ public NavigableSet<E> tailSet(@ParametricNullness E fromElement, boolean inclus
18811883
* <p>The returned navigable set will be serializable if the specified navigable set is
18821884
* serializable.
18831885
*
1886+
* <p><b>Java 8 users and later:</b> Prefer {@link Collections#synchronizedNavigableSet}.
1887+
*
18841888
* @param navigableSet the navigable set to be "wrapped" in a synchronized navigable set.
18851889
* @return a synchronized view of the specified navigable set.
18861890
* @since 13.0

‎guava/src/com/google/common/collect/Sets.java

+4
Original file line numberDiff line numberDiff line change
@@ -1796,6 +1796,8 @@ static boolean equalsImpl(Set<?> s, @CheckForNull Object object) {
17961796
* <p>The returned navigable set will be serializable if the specified navigable set is
17971797
* serializable.
17981798
*
1799+
* <p><b>Java 8 users and later:</b> Prefer {@link Collections#unmodifiableNavigableSet}.
1800+
*
17991801
* @param set the navigable set for which an unmodifiable view is to be returned
18001802
* @return an unmodifiable view of the specified navigable set
18011803
* @since 12.0
@@ -1962,6 +1964,8 @@ public NavigableSet<E> tailSet(@ParametricNullness E fromElement, boolean inclus
19621964
* <p>The returned navigable set will be serializable if the specified navigable set is
19631965
* serializable.
19641966
*
1967+
* <p><b>Java 8 users and later:</b> Prefer {@link Collections#synchronizedNavigableSet}.
1968+
*
19651969
* @param navigableSet the navigable set to be "wrapped" in a synchronized navigable set.
19661970
* @return a synchronized view of the specified navigable set.
19671971
* @since 13.0

0 commit comments

Comments
 (0)
Please sign in to comment.