From 01dcc2e6104e9bd0392cb19029edf2c581425b67 Mon Sep 17 00:00:00 2001 From: Tiramisu Mokka Date: Mon, 26 Jun 2023 07:48:39 -0700 Subject: [PATCH] describe alternative for unmodifiable/synchronizedNavigableSetNavigableSet for java8 users Fixes #3283 RELNOTES=n/a PiperOrigin-RevId: 543436855 --- android/guava/src/com/google/common/collect/Sets.java | 4 ++++ guava/src/com/google/common/collect/Sets.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/android/guava/src/com/google/common/collect/Sets.java b/android/guava/src/com/google/common/collect/Sets.java index 691a4bf78130..4a62001f1f63 100644 --- a/android/guava/src/com/google/common/collect/Sets.java +++ b/android/guava/src/com/google/common/collect/Sets.java @@ -1737,6 +1737,8 @@ static boolean equalsImpl(Set s, @CheckForNull Object object) { *

The returned navigable set will be serializable if the specified navigable set is * serializable. * + *

Java 8 users and later: 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 @@ -1881,6 +1883,8 @@ public NavigableSet tailSet(@ParametricNullness E fromElement, boolean inclus *

The returned navigable set will be serializable if the specified navigable set is * serializable. * + *

Java 8 users and later: 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 diff --git a/guava/src/com/google/common/collect/Sets.java b/guava/src/com/google/common/collect/Sets.java index c00cfae0cc6f..057888f3e680 100644 --- a/guava/src/com/google/common/collect/Sets.java +++ b/guava/src/com/google/common/collect/Sets.java @@ -1796,6 +1796,8 @@ static boolean equalsImpl(Set s, @CheckForNull Object object) { *

The returned navigable set will be serializable if the specified navigable set is * serializable. * + *

Java 8 users and later: 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 @@ -1962,6 +1964,8 @@ public NavigableSet tailSet(@ParametricNullness E fromElement, boolean inclus *

The returned navigable set will be serializable if the specified navigable set is * serializable. * + *

Java 8 users and later: 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