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

Generated builder code should use List.copyOf(l) instead of Collections.unmodifiableList(new ArrayList<>(l)) #6947

Closed
ljnelson opened this issue Jun 5, 2023 · 1 comment
Assignees
Labels
4.x Version 4.x builder Related to the builder support

Comments

@ljnelson
Copy link
Member

ljnelson commented Jun 5, 2023

Some generated builder code features:

Collections.unmodifiableList(new ArrayList<>(listToCopy));

…but should use:

List.copyOf(listToCopy);

…instead.

@ljnelson ljnelson added 4.x Version 4.x builder Related to the builder support labels Jun 5, 2023
@tomas-langer
Copy link
Member

Fixed by #7008

Still using other methods for Set and Map, as we want to preserve order of insertion.

@m0mus m0mus added this to Backlog Aug 12, 2024
@m0mus m0mus moved this to Closed in Backlog Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x builder Related to the builder support
Projects
Archived in project
Development

No branches or pull requests

3 participants