Hey,
On Thu, Jul 7, 2011 at 9:56 AM, Gary Gregory wrote:
> Hi All:
>
> I do like using NullArgumentException, but I find writing this over and over
> tedious:
>
> if (arg == null) {
> thrown new NullArgumentException(argName);
> }
> something(arg);
>
> How about this instead:
>
> NullArgumentExc
On Thu, Jul 7, 2011 at 1:17 PM, Gary Gregory wrote:
> On Thu, Jul 7, 2011 at 1:11 PM, Matt Benson wrote:
>
>> On Thu, Jul 7, 2011 at 11:56 AM, Gary Gregory
>> wrote:
>> > Hi All:
>> >
>> > I do like using NullArgumentException, but I find writing this over and
>> over
>> > tedious:
>> >
>> > if
On Thu, Jul 7, 2011 at 1:11 PM, Matt Benson wrote:
> On Thu, Jul 7, 2011 at 11:56 AM, Gary Gregory
> wrote:
> > Hi All:
> >
> > I do like using NullArgumentException, but I find writing this over and
> over
> > tedious:
> >
> > if (arg == null) {
> > thrown new NullArgumentException(argName);
>
I use an Assert class (similar to commons Validate):
Assert.notNull(argName, arg);
http://ci.apache.org/projects/ofbiz/site/javadocs/org/ofbiz/base/util/Assert.html
The difference is it throws IllegalArgumentException.
-Adrian
On 7/7/2011 5:56 PM, Gary Gregory wrote:
Hi All:
I do like usin
On Thu, Jul 7, 2011 at 11:56 AM, Gary Gregory wrote:
> Hi All:
>
> I do like using NullArgumentException, but I find writing this over and over
> tedious:
>
> if (arg == null) {
> thrown new NullArgumentException(argName);
> }
> something(arg);
>
> How about this instead:
>
> NullArgumentExceptio
Hi All:
I do like using NullArgumentException, but I find writing this over and over
tedious:
if (arg == null) {
thrown new NullArgumentException(argName);
}
something(arg);
How about this instead:
NullArgumentException.check(arg, argName);
something(arg);
or:
something(NullArgumentException