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

Fixes serialization error after duplicate dashboard column #3197

Conversation

OnkelDok
Copy link
Member

@OnkelDok OnkelDok commented Feb 23, 2023

https://forum.portfolio-performance.info/t/nach-duplizieren-einer-spalte-im-dashboard-kann-xml-nicht-mehr-geparst-werden/23294

Sorry for including the error with #3175. I blindly followed the code change suggestion from eclipse. The .toList() creates an immutable list which leads to serialization problem.

@buchen
Copy link
Member

buchen commented Feb 24, 2023

No problem. I ran into a similar problem. We really have to be careful about the "toList" usage.

Wherever we know that the immutable list will not do it, we could add // NOSONAR mutable at the end of the line. Then we a) do not get the suggestion from Sonar again and b) know why not to refactor this in 5 years again...

@buchen buchen merged commit 5c6e5ec into portfolio-performance:master Feb 24, 2023
@buchen
Copy link
Member

buchen commented Feb 24, 2023

Or we add a toMutableList collector ourselves - which is used in all places where we must have a mutable list

buchen added a commit that referenced this pull request Feb 25, 2023
It's useful in cases where we need to modify the resulting list, which
is not possible with the immutable list returned by the Stream#toList
method. We use this method to differentiate between cases where a
mutable list is necessary and to prevent the IDE from suggesting the use
of Stream#toList.

Issue: #3197
@OnkelDok OnkelDok deleted the fix_serialization_error_when_duplicate_dashboard_column branch March 28, 2023 19:04
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.

None yet

2 participants