commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <>
Subject Re: [lang] StringUtils.containsOnly
Date Thu, 26 Sep 2002 17:18:31 GMT
From: "Steve Downey" <>
On Thursday 26 September 2002 04:54 am, Stephen Colebourne wrote:
> > My view is that one of the main advantages of StringUtils is to avoid
> > I actually thought that we'd been through all the methods and ensured
> > none of them did throw a NPE.
> I think that's overkill. You have to decide what to do with null, and
> the right thing to do is throw an NPE. Treating null as "" generally isn't
> good idea. If that's what you want, using StringUtils.clean() in the
> code works.

I go further than this - in my world a product like [lang] would never throw
NPEs. If it did then that would be a bug. If null is a disallowed parameter
then that should be checked and thrown as an IllegalArgumentException. But
thats just my coding style.

Its probably a pity that we didn't agree a uniform approach to this, but its
too late now. The priority is to document what we have correctly.


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

View raw message