You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2020/04/09 14:05:09 UTC

[GitHub] [commons-collections] michael-o edited a comment on issue #117: Better NPE messages in CollectionUtils with Objects.requireNonNull

michael-o edited a comment on issue #117: Better NPE messages in CollectionUtils with Objects.requireNonNull
URL: https://github.com/apache/commons-collections/pull/117#issuecomment-611546027
 
 
   > 
   > 
   > > Thanks @garydgregory @michael-o . I had keep it simple now.
   > > @garydgregory @michael-o What about the issue returned IllegalArgumentException and now would return NullPointerException?
   > > Thanks @kinow .
   > 
   > @dota17
   > The PR looks good. I think it is OK in this case to trade one unchecked exception for another. NPE is more precise and does not break binary compatibility of method signatures.
   
   Correct, especially there unchecked should be swapped for correctness. IAE and NPE almost always indicate programming errors. If there is a null, throw always an NPE.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services