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

Comparing objects which have nested objects as properties leads to wrong results #1216

Closed
eternalconcert opened this issue Aug 22, 2022 · 3 comments
Labels

Comments

@eternalconcert
Copy link

When having two objects of which one has a child object, JaVers is not able to recognize the difference,
when the properties of the child object have the same values as the corresponding default value in
org.javers.common.collections.Defaults
The first test ends successful, because the child Item has the value property `1`, which differs from the default
in Defaults (0).
The second test fails, because the child Item has the value property `0`, which is the same as the default in
Defaults (0).
In both tests the itemParentA, which has a child Item is compared to the itemParentB, which has no child Item.
Please ensure, that removed nested objects are removed properly. I think the Problem is the FakeNode which uses the
defaults from Defaults in the methods getDehydratedPropertyValue and getPropertyValue.
The behaviour can be reproduced with other data types.

...

Steps To Reproduce
I have a **runnable test case ** which isolates the bug and allows Javers Core Team to easily reproduce it. I have pushed this test case to my fork of this repository:

postadress@4cd68a1

I also created a pull request.

Javers' Version
6.6.5

Additional context
...

@bartoszwalacik
Copy link
Member

#1215

@eternalconcert
Copy link
Author

I updated my fork with a new config parameter, to address this issue. Please review and merge my pull request.

@bartoszwalacik
Copy link
Member

fixed in 6.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants