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 CharSequence property of different types returns ValueChange for same value #262
Comments
Hi @rschertz , we are moving Q&A to stackoverflow, see http://stackoverflow.com/questions/tagged/javers?sort=newest I dont know much about Avro Utf8 String. JaVers compares ValueTypes using equals(). |
I wasn't certain where to add that question. Yes, I can move the question Thanks, On Sat, Dec 5, 2015 at 4:44 PM, Bartosz Walacik notifications@github.com
|
let me know when you post this question at Stack |
closing due to lack of activity |
This is related to comparing CharSequence values in issue #250.
Having looked into the implementation of an Avro Utf8 string, I added a test to compare CharSequence property values where the value instances are of different types.
Adding the test below to Case250CharSequence.java:
I expected (well, hoped) that the String value "New York" would compare to the Avro Utf8 value "New York", however the city property values are identified as a ValueChange.
java.lang.AssertionError: expected size:<1> but was:<2> in:<[ValueChange{globalId:'com.maxpoint.minion.monitor.change.JaVersAvroUtf8Test$AvroAddress/', property:'city', oldVal:'New York', newVal:'New York'}, ValueChange{globalId:'com.maxpoint.minion.monitor.change.JaVersAvroUtf8Test$AvroAddress/', property:'street', oldVal:'First Avenue', newVal:'Second Avenue'}]>
Caveat from the 'CharSequence.java' documentation:
This interface does not refine the general contracts of the {@link
Questions: How should the diff engine treat this value type comparison? Can the diff engine reliably suppress this as appearing as a ValueChange?
Note: I have considered experimenting with a custom comparator, but have not yet.
Thanks,
Rick
The text was updated successfully, but these errors were encountered: