-
Notifications
You must be signed in to change notification settings - Fork 481
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
Duplication of collections elements #667
Comments
@leonardoluiz ; it looks like you've committed a fix to your own branch, but not raised a PR. Can you raise a PR? |
@garethahealy actually there are two possible fixes. One is local to The second fix is global for What do you think, what is the best way to proceed here? |
@orange-buffalo if the second solution prevents mappings like
Then this would break our production code. We use these in conjunction with map-null=false to map either-or fields. |
@grubeninspekteur thank you for your feedback! It looks like the only option for us is to have a local fix for |
PR submitted. Thanks! @garethahealy @orange-buffalo @grubeninspekteur |
@leonardoluiz thank you! |
@garethahealy many thanks, we appreciate this! |
Whats your runtime?
Whats the problem?
When a class is configured with class level is-accessible="true", and a List attribute in this class is annotated with @mapping, the elements of that attribute are being duplicated.
Steps to reproduce:
Observed Results:
The destination attribute will have two elements (destination.items.size() = 2).
Expected Results:
The destination attribute should have the same number of elements found in the source object.
Link to GitHub repo with Unit test
https://github.com/leonardoluiz/dozer-testcases/blob/master/src/test/java/org/dozer/testcase/MappingDuplicatesCollectionItemsTest.java
The text was updated successfully, but these errors were encountered: