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

CustomBigDecimalComparator NullPointerException #769

Closed
buderjoh opened this Issue Jan 14, 2019 · 4 comments

Comments

Projects
None yet
2 participants
@buderjoh
Copy link

buderjoh commented Jan 14, 2019

If you use org.javers.core.diff.custom.CustomBigDecimalComparator with a null value you get an NPE

image

There should be a null check for setScale and possibly for aRounded.equals(bRounded); aswell.

Also minor issue

The comment in line 21 is missing the .class -> BigDecimal.class

JaversBuilder.javers().registerCustomComparator(new CustomBigDecimalComparator(2), BigDecimal).build();

@bartoszwalacik

This comment has been minimized.

Copy link
Member

bartoszwalacik commented Jan 15, 2019

You are right. CustomBigDecimalComparator is here just to serve as the example of CustomComparator, so it's not critical. Contribute a PR with the fix if you like.

@bartoszwalacik bartoszwalacik added the bug label Jan 15, 2019

@buderjoh

This comment has been minimized.

Copy link
Author

buderjoh commented Jan 16, 2019

Yeah it is not critical :)
i have written my own Comparator

PR -> 771

@bartoszwalacik

This comment has been minimized.

Copy link
Member

bartoszwalacik commented Jan 18, 2019

merged, it will be released in the next release

@bartoszwalacik

This comment has been minimized.

Copy link
Member

bartoszwalacik commented Feb 16, 2019

fix released in 5.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.