>> * 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. Paul --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org