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

fix equals/hashcode on class with inner class #244

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

frecco75
Copy link
Collaborator

@frecco75 frecco75 commented Mar 24, 2020

A proposal solution for #240.

The problem was the lombok @builder generates an all args constructor. Pojo tester invokes that constructor with generated values.
When the valueChanger tried to change inner class value, because it doesn't find a corresponding valueChanger it returned the same value.

A solution is to return null, which is by construction different from the initial generated value.

@@ -53,7 +53,7 @@ public T increaseValue(final T value) {
return (T) next.increaseValue(value);
}
LOGGER.debug("Could not change value '{}' ot type {} by any field value changer", value, value.getClass());
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we add more info to this log? to create custom value changers in that case?
shall it be in WARN level?

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.

2 participants