Refactor: Check equality with literal on lhs#987
Conversation
There are some equals() that are not constant.equals(variable), but variable.equals(constant)
|
|
@AlexCai2019 refactoring is not encouraged in this project, but I think in this case it improves the code. If you get a chance to add some test coverage in the next 3 days, it would be appreciated. Otherwise, I can add something later. |
|
What problem does this code solve? Does the code still compile with Java6? Risks Changes to the API? Will this require a new release? Should the documentation be updated? Does it break the unit tests? Was any code refactored in this commit? Review status Starting 3-day comment window |




There are some equals() that are not
constant.equals(variable), butvariable.equals(constant).I suggested to always use
constant.equals(variable), since it can avoid vary unintentionally bug, such asNullPointerException.