commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrian Crum (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LANG-618) Add an Assert class to simplify programming.
Date Thu, 15 Apr 2010 13:18:48 GMT

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

Adrian Crum commented on LANG-618:
----------------------------------

A wrapper won't work. Let's say the bar argument is null. The Assert.argumentsNotNull method
will throw an IllegalArgumentException with the message "bar cannot be null." If I have a
wrapper that calls Validate.notNull, the argument name gets discarded and a NullPointerException
is thrown with the message "The validated object is null." Which object was null? Foo or bar?
The Assert class gives the developer more information.

I'm not trying to push this btw. I'm just explaining why I prefer it.


> Add an Assert class to simplify programming.
> --------------------------------------------
>
>                 Key: LANG-618
>                 URL: https://issues.apache.org/jira/browse/LANG-618
>             Project: Commons Lang
>          Issue Type: New Feature
>          Components: lang.*
>    Affects Versions: 3.1
>            Reporter: Adrian Crum
>            Priority: Minor
>         Attachments: LANG-618.patch
>
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message