Skip to content

Errorprone BoxedPrimitiveEquality error on generated code by jsonschema2pojo #1625

Open
@juherr

Description

When using ErrorProne on my project using jsonschema2pojo, it complains about the following errors:

[BoxedPrimitiveEquality] Comparison using reference equality instead of value equality. Reference equality of boxed primitive types is usually not useful, as they are value objects, and it is bug-prone, as instances are cached for some values but not others.

((this.myInteger == rhs.myInteger)||((this.myInteger!= null)&&this.myInteger.equals(rhs.myInteger)))

According to ErrorProne, the generated code should be:

(Objects.equals(this.myInteger, rhs.myInteger))

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions