Actually, I like have both: isEmpty(s) which means 'is "" or not'
and hasValue or isSomething which means 'is a not a white space string or null' Gary -----Original Message----- From: Lavandowska [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 13:46 To: Jakarta Commons Developers List Subject: RE: [lang] Pre 2.0 StringUtils NPE changes I think (and my personal experience) is that the isEmpty() acts as a short-cut for "has a value"; where value is not a whitespace character and is not null (thus the trim - whitespaces are not 'valued'). This is so subjective though, I'm sure hasValue() would quickly be shot down ;-) --- Janek Bogucki <[EMAIL PROTECTED]> wrote: > On Fri, 2003-07-18 at 13:49, Hope, Matthew wrote: > > interesting problem... > > > > "empty string" has a very clear meaning in java, it is a non null > String > > object of zero length. > > > > Does the entrenched user base merit retaining a non standard naming > > convention. > > > > or is Empty sufficiently entrenched to also mean null? (I don't > think it is) > > > > I appreciate the dilemma but as a user would prefer it if the > convention of > > empty stayed as "" and only "". (but swallowing nulls and returning > false id > > just the ticket) > > > > My 2 cents > > > > Matt > > This is the same as way I always interpret 'empty' in the context of > a > Java String object. A empty String is a zero length String, not a > null > object reference. > > I can easily see that equating a null to an empty String is > convenient > but I'd be happy to be explicit about this assumed equivalence in my > code than have a method with a slightly misleading name. > > -Janek ===== Lance Lavandowska Http://www.brainopolis.com/ __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
