-
-
Notifications
You must be signed in to change notification settings - Fork 798
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
JsonLocation
in 2.13 only uses identity comparison for "content reference"
#739
Comments
I am not sure there is much that can be done here, unfortunately, since it is uncertain if calling But I would be interested in knowing specific use case: what is the content reference in specific case you encounter? |
In my case, the source/content reference is a java.io.File. Here's a small class to reproduce the problem. It prints "true" for 2.12.5 and "false" for 2.13.1.
|
Yeah this is tricky. I guess it'd be possible to implement logic for some well-known types like:
to consider equality. It'd be clunky and not extensible. But would resolve the immediate issue. |
JsonLocation
in 2.13 only uses identity comparison for "content reference"
Please see my comment at c5aa1e1#r64115421 |
In 2.12, JsonLocation.equals() uses equals() to check equality on JsonLocation._sourceRef
https://github.com/FasterXML/jackson-core/blob/2.12/src/main/java/com/fasterxml/jackson/core/JsonLocation.java#L150
In 2.13, JsonLocation._sourceRef was renamed and moved to ContentReference.
JsonLocation.equals() still uses equals() to check equality on JsonLocation._contentReference:
https://github.com/FasterXML/jackson-core/blob/2.13/src/main/java/com/fasterxml/jackson/core/JsonLocation.java#L276
but ContentReference.equals() uses == to check equality on ContentReference._rawContent:
https://github.com/FasterXML/jackson-core/blob/2.13/src/main/java/com/fasterxml/jackson/core/io/ContentReference.java#L360
This changes the behaviour of JsonLocation.equals() between 2.12 and 2.13, breaking client code that relies on JsonLocation.equals().
The text was updated successfully, but these errors were encountered: