-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
enhancementNew feature or requestNew feature or requestlow-prioritynew-lintA new lint.A new lint.unnecessary-complexityunresolvedSome decisions have not been made yet or it is not obvious what should be detected.Some decisions have not been made yet or it is not obvious what should be detected.
Description
What it does
When the left-hand side or right-hand side is guaranteed to not be null
, it is more readable to use rhs.equals(lhs)
or lhs.equals(rhs)
than Objects.equals(lhs, rhs)
.
Unresolved: Is this more readable or just pedantic?
Lint Name
No response
Category
No response
Example
Objects.equals(variable, MY_CONSTANT)
Could be written as:
MY_CONSTANT.equals(variable)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestlow-prioritynew-lintA new lint.A new lint.unnecessary-complexityunresolvedSome decisions have not been made yet or it is not obvious what should be detected.Some decisions have not been made yet or it is not obvious what should be detected.