Skip to content
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

PowerSet.equals depends on set's iteration order #3890

Closed
RyanSkonnord opened this issue May 3, 2020 · 3 comments
Closed

PowerSet.equals depends on set's iteration order #3890

RyanSkonnord opened this issue May 3, 2020 · 3 comments
Milestone

Comments

@RyanSkonnord
Copy link
Contributor

If com.google.common.collect.Sets.powerSet is called with two different sets that contain the same elements but in a different iteration order, the returned power sets will also contain the same elements but in a different iteration order. Therefore, Set.equals on those power sets is true, but com.google.common.collect.Sets.PowerSet.equals incorrectly returns false.

@cpovirk
Copy link
Member

cpovirk commented May 4, 2020

Wow, almost 7 years old! Nice find.

@RyanSkonnord
Copy link
Contributor Author

Thanks! 😁

nick-someone pushed a commit that referenced this issue May 4, 2020
…are the same, but in a different iteration order.

RELNOTES:
  Fix issue where PowerSet.equals(PowerSet) would erroneously return
  false if the PowerSet's underlying Sets were equal, but in a different
  iteration order.

Fixes #3891, #3890

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=309745434
nick-someone pushed a commit that referenced this issue May 4, 2020
…are the same, but in a different iteration order.

RELNOTES:
  Fix issue where PowerSet.equals(PowerSet) would erroneously return
  false if the PowerSet's underlying Sets were equal, but in a different
  iteration order.

Fixes #3891, #3890

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=309745434
@cpovirk cpovirk closed this as completed May 5, 2020
@cpovirk cpovirk added this to the NEXT milestone May 5, 2020
@mattysday
Copy link

👍👍👍👍😀😀

@cpovirk cpovirk modified the milestones: NEXT, 30.0 Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@cpovirk @RyanSkonnord @mattysday and others