mengdiwang / guava-libraries

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

ComparisonChain throws NullPointerException #500

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
...when comparing null values, unless using a nullsFirst or nullsLast 
comparator.

If this is intentional, this behavior should perhaps be documented better, as 
it differs from the Commons Lang CompareToBuilder, from which some people might 
be migrating.

Original issue reported on code.google.com by eric.j...@gmail.com on 17 Dec 2010 at 12:36

Attachments:

GoogleCodeExporter commented 9 years ago
It's universally true in Guava that if a method parameter (of reference/array 
type) isn't annotated @Nullable, it won't accept null (and will throw NPE).  I 
understand the suggestion that it might be worth calling out explicitly here 
anyway, but... I don't personally think it should need to be.

Original comment by kevinb@google.com on 17 Dec 2010 at 6:37

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 19 Dec 2010 at 8:26

GoogleCodeExporter commented 9 years ago
thank you kevinb.

Original comment by jokoswt@gmail.com on 15 Nov 2012 at 2:08

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