1. Setup a mapping of a field of type List to another List field
2. Select remove-orphans="true"
3. Add a few elements to the source list
4. Compare the order of the target list with the source list
MappingProcessor#addOrUpdateToList() puts the elements into the mappedElements HashSet. If the source list contains a few elements the hashCode() method reorders the elements in mappedElements. This makes the result order different than the source order.
See the attachment for a working example.
The fix is to change mappedElements to ArrayList.
It seems that MappingProcessor#addToSet() could use HashSet for its mappedElements instead of ArrayList. It looks like the types of mappedElements in addOrUpdateToList() and addToSet() are swapped.
Log in to post a comment.