commons-issues mailing list archives

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


Adrian Crum commented on LANG-618:

If I use the wrapper method, then I end up with this:

Assert.argumentsNotNull("Argument \"foo\" cannot be null.", foo, "Argument \"bar\" cannot
be null.", bar, ...);

and I still get a NullPointerException instead of an IllegalArgumentException.

The bottom line is, I would be trying to use Validate for something it wasn't designed for.
It just isn't a good fit.

The idea behind Assert was to make argument checking convenient - so that it will be done
more often, and to make the exceptions it throws meaningful to developers.

> Add an Assert class to simplify programming.
> --------------------------------------------
>                 Key: LANG-618
>                 URL:
>             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:
For more information on JIRA, see:


View raw message