Skip to content

Disallow mutable array use as a constant#10604

Merged
findepi merged 2 commits intotrinodb:masterfrom
findepi:findepi/immutable-array
Jan 15, 2022
Merged

Disallow mutable array use as a constant#10604
findepi merged 2 commits intotrinodb:masterfrom
findepi:findepi/immutable-array

Conversation

@findepi
Copy link
Copy Markdown
Member

@findepi findepi commented Jan 14, 2022

Arrays are mutable, so are not suitable for public static fields.

@cla-bot cla-bot bot added the cla-signed label Jan 14, 2022
@findepi findepi force-pushed the findepi/immutable-array branch 2 times, most recently from 0a3e98b to 6524fbe Compare January 14, 2022 10:31
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consider using ImmutableList instead?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@findepi
Copy link
Copy Markdown
Member Author

findepi commented Jan 14, 2022

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.
@findepi findepi force-pushed the findepi/immutable-array branch from 6524fbe to 9892e61 Compare January 15, 2022 09:26
@findepi findepi merged commit 2190ab7 into trinodb:master Jan 15, 2022
@findepi findepi deleted the findepi/immutable-array branch January 15, 2022 09:26
@github-actions github-actions bot added this to the 369 milestone Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants