-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add [
SequencedCollection
](https://docs.oracle.com/en/java/javase/21…
…/docs/api/java.base/java/util/SequencedCollection.html) methods to `ImmutableSortedSet`. There are a couple reasons that this is maybe kind of nice, and then there's my real motivation for doing it. Reasons that this is maybe kind of nice: - We add `@DoNotCall` and `@Deprecated` to the mutator methods, as usual. - We refine the return type of `reversed()` to `ImmutableSortedSet`. But again, those aren't my real motivation. (If they _were_ my real motivation, you might notice, then there would be no reason for us to override `getFirst()` and `getLast()`.) My _real_ motivation is that we are looking to give `guava-android` APIs that use Java 8+ types in their signatures, such as `ImmutableSet.toImmutableSet`. And as a result of some part of those changes, we start seeing errors in some of our Google-internal build rules. Those errors come because some the desugaring process is inserting its own versions of `getFirst` and friends, versions that refer to the desugar-provided copies of `SortedSet` and `NavigableSet`, which our build process then looks for but cannot find. Since this CL is preparation for adding `ImmutableSet.toImmutableSet`, it constitutes further progress toward #6567 RELNOTES=`collect`: Added [`SequencedCollection`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/SequencedCollection.html) methods to `ImmutableSortedSet`. PiperOrigin-RevId: 575207552
- Loading branch information
Showing
2 changed files
with
176 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters