mengdiwang / guava-libraries

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

Equivalences.identity()'s behavior does not match its Javadoc #511

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In com.google.common.base.Equivalences.equivalent()'s Javadoc:

http://code.google.com/p/guava-libraries/source/browse/trunk/src/com/google/comm
on/base/Equivalences.java?r=144#55

"{@link Equivalence#equivalent} returns {@code true} if both values are null"
--> but implementation throws NPE when 'a' is null.

"{@link Equivalence#hash} throws a {@link NullPointerException} if passed a 
null value"
--> but implementation returns 0 when passed a null value (because 
System.identityHashCode() returns 0 for null values)

Thanks :)

Original issue reported on code.google.com by nev...@gmail.com on 30 Dec 2010 at 11:49

GoogleCodeExporter commented 9 years ago
Thanks :-)

Original comment by kurt.kluever on 31 Dec 2010 at 4:07

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 12 Jan 2011 at 9:01

GoogleCodeExporter commented 9 years ago
Issue 522 has been merged into this issue.

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

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago

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

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