commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thiago Andrade (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-1008) Adding the maxVA and minVA methods to NumberUtils and test methods
Date Mon, 05 May 2014 20:55:20 GMT

    [ https://issues.apache.org/jira/browse/LANG-1008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13989961#comment-13989961
] 

Thiago Andrade commented on LANG-1008:
--------------------------------------

[~michael-o] you are right! I around the web and found this [NullPointerException is a great
way to tell, that an argument should not be null|http://books.google.com.br/books?id=ka2VUBqHiWkC&pg=PA248&lpg=PA248&dq=%22Arguably,+all+erroneous+method+invocations+boil+down+to+an+illegal+argument+or+illegal+state,+but+other+exceptions+are+standardly+used+for+certain+kinds+of+illegal+arguments+and+states.+If+a+caller+passes+null+in+some+parameter+for+which+null+values+are+prohibited,+convention+dictates+that+NullPointerException+be+thrown+rather+than+IllegalArgumentException.+Similarly,+if+a+caller+passes+an+out-of-range+value+in+a+parameter+representing+an+index+into+a+sequence,+IndexOutOfBoundsException+should+be+thrown+rather+than+IllegalArgumentException.%22&source=bl&ots=yYLoLgqZT4&sig=2npCOGZcepQ954Cg8LISYc2iGNA&hl=en&sa=X&ei=xvlnU4jSIYHJsQTpg4DIAQ&ved=0CCgQ6AEwAA#v=onepage&q=%22Arguably%2C%20all%20erroneous%20method%20invocations%20boil%20down%20to%20an%20illegal%20argument%20or%20illegal%20state%2C%20but%20other%20exceptions%20are%20standardly%20used%20for%20certain%20kinds%20of%20illegal%20arguments%20and%20states.%20If%20a%20caller%20passes%20null%20in%20some%20parameter%20for%20which%20null%20values%20are%20prohibited%2C%20convention%20dictates%20that%20NullPointerException%20be%20thrown%20rather%20than%20IllegalArgumentException.%20Similarly%2C%20if%20a%20caller%20passes%20an%20out-of-range%20value%20in%20a%20parameter%20representing%20an%20index%20into%20a%20sequence%2C%20IndexOutOfBoundsException%20should%20be%20thrown%20rather%20than%20IllegalArgumentException.%22&f=false]
from Effective Java 2nd edition Book from Sun

> Adding the maxVA and minVA methods to NumberUtils and test methods
> ------------------------------------------------------------------
>
>                 Key: LANG-1008
>                 URL: https://issues.apache.org/jira/browse/LANG-1008
>             Project: Commons Lang
>          Issue Type: New Feature
>          Components: lang.*, lang.math.*
>            Reporter: Thiago Andrade
>              Labels: github
>             Fix For: Review Patch
>
>
> Placeholder ticket for github PR 23: https://github.com/apache/commons-lang/pull/23



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message