google / google/error-prone

Calls to List.equals(Set) and vice versa

Open
#211 4 comments 0 reactions 0 assignees View on GitHub
migrated Priority-Medium Type-NewCheck
Dominant language
Java
Stars
7.2k
Forks
820
Avg merge
5h 9m
Merged PRs (30d)
50

Description

_[Original issue](https://code.google.com/p/error-prone/issues/detail?id=211) created by **cpovirk@google.com** on 2013-11-13 at 08:51 PM_

---

(This differs from another check that I'm pretty sure was in development, the check for equals() on definitively unrelated types, because List and Set aren't definitively unrelated in the same way: As both are interfaces, there's nothing in the rules of inheritance that prevent a class from implementing both. However, given the way that their equals() methods are defined, a class still can't implement both.)

I was kind of excited about this check until my search of Google code found only a single instance. (Well, it found some other instances of issue 81, but that hardly counts, and it found some instances of tests that wanted to be sure that a particular List implementation was never equal to a particular Set implementation, but that's not helpful.) It's possible that people tend to find this bug in their own testing, but still, I'm kind of down on it now :\

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.