Disallow mutable array use as a constant#10604
Merged
findepi merged 2 commits intotrinodb:masterfrom Jan 15, 2022
Merged
Conversation
0a3e98b to
6524fbe
Compare
ksobolew
approved these changes
Jan 14, 2022
kokosing
approved these changes
Jan 14, 2022
Member
There was a problem hiding this comment.
Should we consider using ImmutableList instead?
Member
Author
There was a problem hiding this comment.
Generally yes, but the byte[] is used in other places, so that would be a bigger change, and maybe not warranted in this particular case
losipiuk
approved these changes
Jan 14, 2022
Member
Author
|
Build is green. Will resolve conflict and merge. |
Arrays are mutable, so are not suitable for public static fields.
The checks disabled are WARN level by default. Disable them altogether, for the benefit of anyone who cares to look at the Error Prone output, for whatever reason.
6524fbe to
9892e61
Compare
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.
Arrays are mutable, so are not suitable for public static fields.