commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Benedict <>
Subject Re: Comments on Commons Lang 3.0-SNAPSHOT
Date Tue, 17 Nov 2009 10:59:48 GMT
>> * Validate throws IAE on every failure -- including null arguments.
>> Because NPE is not thrown, it will make this class less and less
>> palatable in the future since that is the favored approach nowadays --
>> and implemented by the JDK and Google. One solution is to expose a
>> pluggable factory that can choose the type of exception to throw.
> I count 137 throw IllegalArgumentException that say 'null' vs 45 throw
> NullPointerExceptions.  So this is a package wide decision to discuss.
> We used to have NullArgumentException having argued about it long ago,
> we recently deleted that and rolled back to IllegalArgumentException.

In regards to Validate, I think it's a BIG DEAL that it throws IAE not
NPE !!! I have deleted its use in several codebases because it does
not match what the "standard" is. And NullArgumentException rightfully
should die :-)

I understand the compatability concern, which is why I want to add the
ability to *plug* in the type of exception it creates. I'll work on
something so you guys can review it.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message