- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 8.6k
[java] Removing old stream collectors required by Java 8 #15523
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
[java] Removing old stream collectors required by Java 8 #15523
Conversation
| PR Reviewer Guide 🔍Here are some key observations to aid the review process: 
 | 
| PR Code Suggestions ✨Explore these optional code suggestions: 
 | |||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @zodac
User description
Motivation and Context
There was some left-over
Collectorlogic that was required in Java 8 to create an unmodifiableMap/Set. Since the minimum Java version has been upgraded to Java 11, we can replace these calls withCollectors#toUnmodifiableMap()andCollectors#toUnmodifiableSet()in the standard library (available since Java 10).Types of changes
Checklist
bazel test //java/... --test_size_filters=small)PR Type
Enhancement
Description
Replaced custom collectors with standard Java 10 collectors.
Removed redundant methods for unmodifiable collections.
Simplified stream operations using
Collectors.toUnmodifiableMapandCollectors.toUnmodifiableSet.Changes walkthrough 📝
PersistentCapabilities.java
Refactored to use Java 10 collectors for unmodifiable collectionsjava/src/org/openqa/selenium/PersistentCapabilities.java
toUnmodifiableMapwithCollectors.toUnmodifiableMap.toUnmodifiableSetwithCollectors.toUnmodifiableSet.