Skip to content
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

[MNG-8484] Replace BaseRequest#unmodifiable with List.copyOf() #2037

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

gnodet
Copy link
Contributor

@gnodet gnodet commented Jan 10, 2025

List.copyOf() is exactly what we need to make a defensive copy of the input collection. It also has the benefit of not doing anything if the input collection is already an immutable list.

@gnodet gnodet requested a review from elharo January 10, 2025 18:29
@gnodet gnodet changed the title Rename BaseRequest#unmodifiable to copyToImmutable and add doc Replace BaseRequest#unmodifiable with List.copyOf() Jan 13, 2025
@gnodet gnodet requested a review from cstamas January 13, 2025 15:55
Copy link
Member

@CrazyHZM CrazyHZM left a comment

Choose a reason for hiding this comment

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

LGTM

@elharo elharo changed the title Replace BaseRequest#unmodifiable with List.copyOf() [MNG-8484] Replace BaseRequest#unmodifiable with List.copyOf() Jan 13, 2025
@gnodet gnodet added this to the 4.0.0-rc-3 milestone Jan 13, 2025
@gnodet gnodet merged commit e0effe2 into apache:master Jan 13, 2025
13 checks passed
@gnodet gnodet deleted the copyToImmutable branch January 13, 2025 19:18
@gnodet gnodet restored the copyToImmutable branch January 13, 2025 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants