-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CartesianSet.equals
always returns false for other Set
types
#6780
Comments
That definitely looks like a violation of the contract of As far as I can see, |
Actually, not quite 15 years, but 11, since this commit changed the parent type from |
… equivalent. (inspired by Marcono1234's google/guava#6780) PiperOrigin-RevId: 573814421
… equivalent. (inspired by Marcono1234's google/guava#6780) PiperOrigin-RevId: 573931267
…r `Set`. In 2012 the parent type of `CartesianSet` was changed from `AbstractSet` to `ForwardingCollection`, with the inadvertent effect that a `CartesianSet` can never compare equal to another `Set` unless that is also a `CartesianSet`. Fixes #6780. RELNOTES=n/a PiperOrigin-RevId: 573517273
Version
32.1.3-jre
Description
The internal class
CartesianSet
returned bySets.cartesianProduct
implementsequals
in a way that it is never equal to any otherSet
type because it callssuper.equals
which is actuallyObject.equals
(and therefore checks for object identity).That does not seem intended.
Example
The text was updated successfully, but these errors were encountered: