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
Support JDK 21 Sequenced Collections #6903
Comments
One thing that Rhys mentioned that I hadn't considered before was the documentation aspect: For someone new to, say, Then there's the benefit of the methods themselves, like |
1. What are you trying to do?
Please see JEP-431 for background on what a Sequenced Collection is.
The javadoc for ImmutableCollection mentions that most Guava Collections have a well-defined iteration order. Indeed, I often rely on this behaviour. This issue is to discuss support for the SequencedCollections interface, in order to better communicate that Guava Collections have this property.
2. What's the best code you can write to accomplish that without the new feature?
This example does not make much sense without the context of the added methods in SequencedCollection, however:
3. What would that same code look like if we added your feature?
Sequenced Collections add new convenience methods that arise from having a defined iteration order. Applying this to (for example) ImmutableSet, which preserves insertion order, would result in the following code being valid:
(Optional) What would the method signatures for your feature look like?
No response
Concrete Use Cases
I have not yet used Guava with JDK 21.
Please see related Guava discussion: https://groups.google.com/g/guava-discuss/c/IXWZCHn7yJs
Packages
com.google.common.collect
Checklist
I agree to follow the code of conduct.
I have read and understood the contribution guidelines.
I have read and understood Guava's philosophy, and I strongly believe that this proposal aligns with it.
I have visited the idea graveyard, and did not see anything similar to this idea.
The text was updated successfully, but these errors were encountered: