Suggest this == obj instead of super.equals(obj) when the two are equivalent.#4147
Conversation
492e8d0 to
3047300
Compare
|
Thanks @cpovirk! If you have time and energy for this, do you think it would also make sense to cover |
|
You're welcome. It has found way more problems than I expected, so thanks!
|
|
The return id == null ? super.hashCode() : id.hashCode();There are also some false-positive examples similar to what I'd seen with The checker is probably still worth doing, but it's not a complete no-brainer, so I'll try to come back to this when I have more brain to spare. |
|
Eh, it looks like those are (mostly? entirely?) in classes whose |
…o "`SuperCallToObjectMethod`." ...as suggested by @Marcono1234 in #4147 (comment). Also, add docs. PiperOrigin-RevId: 574501701
…o "`SuperCallToObjectMethod`." ...as suggested by @Marcono1234 in #4147 (comment). Also, add docs. PiperOrigin-RevId: 574898389
|
Thanks a lot for extending the check and also for the extensive documentation! |
|
(I just took a quick peek at |
Suggest
this == objinstead ofsuper.equals(obj)when the two are equivalent.(inspired by Marcono1234's google/guava#6780)