Refactor: Replace explicit type arguments with diamond operator wherever possible across the project#17567
Merged
kfaraz merged 8 commits intoapache:masterfrom Dec 17, 2024
Conversation
kfaraz
reviewed
Dec 16, 2024
Contributor
kfaraz
left a comment
There was a problem hiding this comment.
Looked at some of the files, several more to go.
We should probably leave out the formatting changes to simplify the PR.
Contributor
Author
@kfaraz Have reverted all formatting changes across all files. |
kfaraz
approved these changes
Dec 17, 2024
Contributor
kfaraz
left a comment
There was a problem hiding this comment.
Reviewed all files.
LGTM! 🚀
Contributor
|
Merging since the failures are unrelated. |
Member
|
we should probably enable: |
Contributor
Author
|
@kgyrtkirk Makes sense, thanks for pointing this out! Will do this in a follow-up! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
As pointed out in this review comment, since we aren't supporting Java 8 anymore, we can switch to diamond operators wherever possible without specifying explicit type arguments.
Examples:
This PR makes this change across the project.
Note: This change was done with IntelliJ's project-wide inspection results for warnings like
Explicit type argument Integer, Iterator<Integer> can be replaced with <>. With that, there were a few compilation issues, which were manually fixed.This PR has: