Skip to content

False positive diff for array with maxItems #784

Closed
@rq-trichins

Description

@rq-trichins

In #780, the fix for matching maxItems and minItems was changed to check if "oldValue == newValue". But those are both "Integer" and so the equality is doing an object matching, not an equality of the actual integers. It should be "oldValue.equals(newValue)" or "Objects.equals(oldValue, newValue)".

I'm seeing this when the maxItems is a large number. Sometimes, the JVM reuses the same object for the integer and sometimes it doesn't. When it doesn't reuse the same object, then the existing comparison fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions