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

XMLItem - avoid Arrays.asList #593

Closed
rsoika opened this issue Oct 17, 2019 · 0 comments
Closed

XMLItem - avoid Arrays.asList #593

rsoika opened this issue Oct 17, 2019 · 0 comments
Milestone

Comments

@rsoika
Copy link
Member

rsoika commented Oct 17, 2019

We should avoid Arrays.asList in XMLItem.

The static method Arrays.asList returns an instance of java.util.Arrays$ArrayList which is a nested class inside the Arrays class that implements the List interface. This particular implementation has a fixed size. And this can lead to a problem if the value is later converted back into an ItemCollecton!

The solution is to use instead the constructor to create the list:

new ArrayList<>(Arrays.asList(....));
@rsoika rsoika added this to the 5.1.0 milestone Oct 17, 2019
rsoika added a commit that referenced this issue Oct 17, 2019
@rsoika rsoika closed this as completed Oct 21, 2019
bvfalcon pushed a commit to bvfalcon/imixs-workflow that referenced this issue Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant