META-379: fix PersistentBag and PersistentSortedMap conversion#75
Open
yegres-teluer wants to merge 1 commit into
Open
META-379: fix PersistentBag and PersistentSortedMap conversion#75yegres-teluer wants to merge 1 commit into
yegres-teluer wants to merge 1 commit into
Conversation
yegres-teluer
commented
Dec 16, 2025
|
|
||
| if (source instanceof PersistentList) { | ||
| source = new ArrayList((Collection) source); | ||
| } else if (source instanceof PersistentMap) { |
Author
There was a problem hiding this comment.
checking this before checking for PersistentSortedMap was wrong
yegres-teluer
commented
Dec 16, 2025
| public void marshal(Object source, HierarchicalStreamWriter writer, | ||
| MarshallingContext context, ConverterLookup converterLookup) { | ||
|
|
||
| if (source instanceof PersistentList) { |
Author
There was a problem hiding this comment.
This missed PersistentBag and PersistentIdentifierBag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi team,
This is to fix the long-hanging bug META-379
aka https://openmrs.atlassian.net/browse/META-377
aka https://openmrs.atlassian.net/browse/META-380
aka https://openmrs.atlassian.net/browse/META-381
(not sure why we have all those clones in Jira, but the bug is valid)
The existing conversion logic was not handling PersistentBag, PersistentIdentifierBag, and PersistentSortedMap correctly.
The fix will convert all PersistentCollection implementations correctly.
Added unit tests to validate the solution.