mengdiwang / guava-libraries

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

Revise JavaDoc for Equivalence #522

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The JavaDoc for Equivalence#equivalent() is copied from Object#equals() but a 
wording could be enhanced. E.g. for reflexive:

  It is reflexive: for any non-null reference value x, x.equals(x) should return true. 

to

  It is reflexive: for any non-null reference values x and y, 
equivalent(x,y) should return true.

identity() returns an Equivalence which has nothing to do with equals(). 
Another problem is the mention of "any non-null reference" which is misleading 
if nullAwareEquals() or identity() are used, because null-values are fine. Then 
the exact null-handling is an implementation issue.

Original issue reported on code.google.com by ullenb...@gmail.com on 20 Jan 2011 at 9:35

GoogleCodeExporter commented 9 years ago
Thanks -- we're fixing the doc AND the behavior (which is weirdly non-symmetric 
to nulls).

Original comment by kevinb@google.com on 20 Jan 2011 at 6:52

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 20 Jan 2011 at 6:53

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 20 Jan 2011 at 6:54

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