mengdiwang / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

AndPredicate and OrPredicate Hashcode methods leaves something to be desired. #492

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The HashCode functions for these two classes use AND and OR respectively to 
compose the hashcode, while this almost makes sense when considering the 
functions that the classes perform, it leaves the hashcode function almost 
entirely useless for larger predicates.

If you have 7 predicates within an AND or OR predicate, the likelihood is that 
the hashcode returned from the AND or OR predicate will be either 0 of 
0xFFFFFFFF respectively. 

I'd say this is a cute way of solving the hashcodes but ultimately it goes 
beyond what the class is perceived to do and will cause issues for complex 
predicate structures.

Original issue reported on code.google.com by Bjorn.So...@gmail.com on 6 Dec 2010 at 12:58

GoogleCodeExporter commented 9 years ago
You're right, this is unambiguously an error on our parts.

Original comment by kevinb@google.com on 7 Dec 2010 at 7:53

GoogleCodeExporter commented 9 years ago

Original comment by boppenh...@google.com on 14 Dec 2010 at 12:03

GoogleCodeExporter commented 9 years ago
This should be available the next time we mirror changes to the SVN repo.

Original comment by boppenh...@google.com on 21 Dec 2010 at 1:52

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 18 Jan 2011 at 8:34

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 24 Jan 2011 at 9:34

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:15

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:09