Currently, before calling a CustomValueComparator impl, Javers checks nulls and assumes that :
null != any non-null value
This assumption simplifies an impl, but from the other hand it
makes impossible to write a Comparator which treats nulls as empty values.
See https://stackoverflow.com/questions/66497652/javers-comparison-string-collection-and-boolean-with-defined-rules
public interface CustomValueComparator<T> {
/**
* Called by JaVers to compare two Values.
*
* @param a not null
* @param b not null
*/
boolean equals(T a, T b);
New feature
Skip the Javers internal null-safety logic and allow passing nulls to CustomValueComparators.
Unfortunately it could break existing users' code
Test case
CaseWithCustomComparatorBlejwas.groovy
Currently, before calling a CustomValueComparator impl, Javers checks nulls and assumes that :
This assumption simplifies an impl, but from the other hand it
makes impossible to write a Comparator which treats nulls as empty values.
See https://stackoverflow.com/questions/66497652/javers-comparison-string-collection-and-boolean-with-defined-rules
New feature
Skip the Javers internal null-safety logic and allow passing nulls to CustomValueComparators.
Unfortunately it could break existing users' code
Test case
CaseWithCustomComparatorBlejwas.groovy