Skip to content

False positive in ReferenceEquality check? #5865

@msridhar

Description

@msridhar

To reproduce, clone https://github.com/uber/NullAway, check out the ep-2.50.0 branch, and run ./gradlew :nullaway:compileJava. One of the reported warnings is:

nullaway/src/main/java/com/uber/nullaway/NullAway.java:1179: warning: [ReferenceEquality] Comparison using reference equality instead of value equality
    if (description != Description.NO_MATCH) {

The ReferenceEquality docs say the check should only warn for types that override equals() or inherit equals() from a type other than java.lang.Object. But neither seems to be true for Description:

https://github.com/google/error-prone/blob/4525e7919cbb578e92eb81d86e615424524f2efb/check_api/src/main/java/com/google/errorprone/matchers/Description.java

Is this warning intended?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions