Skip to content

JsonLocation in 2.13 only uses identity comparison for "content reference" #739

Closed
@vladt

Description

@vladt

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().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions