commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <bay...@generationjava.com>
Subject Re: StringUtils.containsOnly
Date Wed, 25 Sep 2002 20:48:27 GMT


On Wed, 25 Sep 2002, Steve Downey wrote:

> > > containsOnly(null, anything) returns false.
> >
> > I could follow this on the grounds that a null string couldn't
> > possibly contain any characters, so should fail.  Still, I find the
> > semantics confusing, since the same argument could be applied to the
> > previous case as well.
>
> This should probably throw a NPE. It's not meaningful to ask if null contains
> a character.

This sounds like a possibility to me, though nothing else in StringUtils
throws an NPE, and I'd think there would be other candidates in there.

Anyone think this is a big issue? 'quiet' null handling versus 'loud'
NPEs?

Hen


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message