You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Stephen Colebourne <sc...@btopenworld.com> on 2003/07/19 00:33:01 UTC

[lang] Proposal (2): isEmpty

Proposal for methods:

- isEmpty() - true for "" or null
- isNotEmpty() - opposite
- isEmptyNN() - true for ""

- isBlank() - trims - true for "  ", "" or null
- isNotBlank() - opposite
- isBlankNN() - trims - true for "  " or ""

- isWhitespace() - true for all whitespace, "" or null
- isNotWhitespace() - opposite
- isWhitespaceNN() - true for all whitespace or ""

Where NN means NotNull.
This covers all the cases, and takes the working premise that more people
want null to be true than false.


Proposal for location:
1) In StringUtils. Incompatable change to isEmpty() (no longer trims) and
isWhitespace() (null now true).

2) In StringTests (new class). Deprecate StringUtils isEmpty/isNotEmpty.


I prefer the incompatable change #1. We are offering a simply named
alternative. Also, some people already don't expect isEmpty to trim. And
Tapestry and Turbine should both be OK.

Stephen

PS. If no agreement is forthcoming, then we shall have to revert to the 1.0
methods in order to get a release.



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


Re: [lang] Proposal (2): isEmpty

Posted by Henri Yandell <ba...@generationjava.com>.
The comments at http://raibledesigns.com/comments/rd/minimal/commons_lang_stringutils
are a good reason for how surprisingly nice people find isEmpty.



On Fri, 18 Jul 2003, Stephen Colebourne wrote:

> Proposal for methods:
>
> - isEmpty() - true for "" or null
> - isNotEmpty() - opposite
> - isEmptyNN() - true for ""

+1. Especially +1 for isEmpty retaining much the same functionality.

> - isBlank() - trims - true for "  ", "" or null
> - isNotBlank() - opposite
> - isBlankNN() - trims - true for "  " or ""

+1
I think this wording works. While I think people do expect isEmpty to be
false for null, I don't think they expect it to go trimming on them
usually.

> - isWhitespace() - true for all whitespace, "" or null
> - isNotWhitespace() - opposite
> - isWhitespaceNN() - true for all whitespace or ""

+1

> Where NN means NotNull.
> This covers all the cases, and takes the working premise that more people
> want null to be true than false.
>
>
> Proposal for location:
> 1) In StringUtils. Incompatable change to isEmpty() (no longer trims) and
> isWhitespace() (null now true).

+1

> 2) In StringTests (new class). Deprecate StringUtils isEmpty/isNotEmpty.

-1. I don't think we want to overly confuse the issue with this yet.
Breaking StringUtils up is a 3.0 thing if desired I believe.

> I prefer the incompatable change #1. We are offering a simply named
> alternative. Also, some people already don't expect isEmpty to trim. And
> Tapestry and Turbine should both be OK.

Agreed.

Hen


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


RE: [lang] Proposal (2): isEmpty

Posted by Henri Yandell <ba...@generationjava.com>.
I think I prefer [was it Gary's?] the idea of having StringUtils being
usable as an instance in which you setup general strategies to overloading
with a boolean variable. No insult intended, but that always seems like a
confusing hack to me.

Hen

On Sat, 19 Jul 2003, Laird J. Nelson wrote:

> > -----Original Message-----
> > From: Stephen Colebourne [mailto:scolebourne@btopenworld.com]
> > It isn't. My preference is now for
> >
> > isEmpty() - "" or null
> > isBlank() - whitespace only, "" or null
> > and maybe:
> > isEmptyTrimmed() - trim() then "" or null
> >
> > (plus isNotEmpty, isNotBlank, isEmptyNN, isBlankNN)
>
> Delurking for a moment, but why not have an extra parameter?
>
> Something like: isEmpty(String, boolean) where the boolean indicates
> whether trim() should be performed or not?  Then isEmpty(String) could
> default to calling it with false as the second parameter.
>
> See, for example,
> http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/foundry/foundry/foundry/t
> ext/Strings.java?rev=1.13&content-type=text/vnd.viewcvs-markup (the
> isEmptyOrNull(Object, boolean)) method.
>
> Cheers,
> Laird
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>


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


RE: [lang] Proposal (2): isEmpty

Posted by "Laird J. Nelson" <la...@comcast.net>.
> -----Original Message-----
> From: Stephen Colebourne [mailto:scolebourne@btopenworld.com]
> It isn't. My preference is now for
>
> isEmpty() - "" or null
> isBlank() - whitespace only, "" or null
> and maybe:
> isEmptyTrimmed() - trim() then "" or null
>
> (plus isNotEmpty, isNotBlank, isEmptyNN, isBlankNN)

Delurking for a moment, but why not have an extra parameter?

Something like: isEmpty(String, boolean) where the boolean indicates
whether trim() should be performed or not?  Then isEmpty(String) could
default to calling it with false as the second parameter.

See, for example,
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/foundry/foundry/foundry/t
ext/Strings.java?rev=1.13&content-type=text/vnd.viewcvs-markup (the
isEmptyOrNull(Object, boolean)) method.

Cheers,
Laird


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


Re: [lang] Proposal (2): isEmpty - commits

Posted by Stephen Colebourne <sc...@btopenworld.com>.
I have updated CVS HEAD as follows:

Removed:
isEmptyOrNull
isNotEmptyOrNull
isEmptyTrimmed
isNotEmptyTrimmed
isEmptyTrimmedOrNull
isNotEmptyTrimmedOrNull

Changed:
isEmpty - true for "" or null
isNotEmpty - opposite (no change from 1.0)

Added:
isBlank - true for all whitespace, "" or null
isNotBlank - opposite

I suggest that committers think if they want to -1 veto this change.

Stephen

----- Original Message -----
From: "Henri Yandell" <ba...@generationjava.com>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
Sent: Saturday, July 19, 2003 9:54 PM
Subject: Re: [lang] Proposal (2): isEmpty


>
> So what's our 2.0 state with regard to this? What needs to be changed?
>
> Do we want to release tight with the following removed from current HEAD:
>
> isEmptyOrNull
> isNotEmptyOrNull
> isEmptyTrimmed
> isNotEmptyTrimmed
> isEmptyTrimmedOrNull
> isNotEmptyTrimmedOrNull
>
> Hen
>
> On Sat, 19 Jul 2003, Stephen Colebourne wrote:
>
> > From: "Henri Yandell" <ba...@generationjava.com>
> > > > It isn't. My preference is now for
> > > >
> > > > isEmpty() - "" or null
> > > > isBlank() - whitespace only, "" or null
> > >
> > > Could just tell people to do isWhitespace && isEmpty  ? :)
> >
> > I feel  isBlank() is more expressive than  isWhitespace(). It just feels
> > more inclusive of null and empty.
> >
> > if (isNotBlank()) {
> >   ...process data
> > }
> > OR
> > if (isNotWhitespace()) {
> >   ...process data
> > }
> >
> > Then again isWhitespace follows our naming definitions.
> >
> > ---
> > > > isEmptyTrimmed() - trim() then "" or null
> > >
> > > I'm not sure there's any need for this. I wonder how much of the chars
> > > less than 32 count as whitespace? But it seems that isWhitespace is
for
> > > most people's usage a superset of isEmptyTrimmed.
> >
> > Yeh, I'm happy to miss it out.
> >
> > ---
> > > > (plus isNotEmpty, isNotBlank, isEmptyNN, isBlankNN)
> > >
> > > Still hard to decide how far to go with all these. isEmptyNN is a
> > > single-atom method. isNotEmpty just replaces a ! sign etc etc.
> >
> > The Nots are very useful for these cases as they are so frequent.
> >
> > ---
> > > Does anyone actually want isEmptyNN, or is it just that people are
unhappy
> > > with the null-handling in StringUtils? In which case I think the NN is
the
> > > wrong solution, we need to be thinking about an ability to create a
> > > StringUtils with a strategy or having an underlying hidden class and 3
> > > facade's for the different strategies. All 3.0.
> >
> > +1. Leave out NN for now. Its a bit of a hack.
> >
> > Stephen
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>


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


Re: [lang] Proposal (2): isEmpty

Posted by Henri Yandell <ba...@generationjava.com>.
So what's our 2.0 state with regard to this? What needs to be changed?

Do we want to release tight with the following removed from current HEAD:

isEmptyOrNull
isNotEmptyOrNull
isEmptyTrimmed
isNotEmptyTrimmed
isEmptyTrimmedOrNull
isNotEmptyTrimmedOrNull

Hen

On Sat, 19 Jul 2003, Stephen Colebourne wrote:

> From: "Henri Yandell" <ba...@generationjava.com>
> > > It isn't. My preference is now for
> > >
> > > isEmpty() - "" or null
> > > isBlank() - whitespace only, "" or null
> >
> > Could just tell people to do isWhitespace && isEmpty  ? :)
>
> I feel  isBlank() is more expressive than  isWhitespace(). It just feels
> more inclusive of null and empty.
>
> if (isNotBlank()) {
>   ...process data
> }
> OR
> if (isNotWhitespace()) {
>   ...process data
> }
>
> Then again isWhitespace follows our naming definitions.
>
> ---
> > > isEmptyTrimmed() - trim() then "" or null
> >
> > I'm not sure there's any need for this. I wonder how much of the chars
> > less than 32 count as whitespace? But it seems that isWhitespace is for
> > most people's usage a superset of isEmptyTrimmed.
>
> Yeh, I'm happy to miss it out.
>
> ---
> > > (plus isNotEmpty, isNotBlank, isEmptyNN, isBlankNN)
> >
> > Still hard to decide how far to go with all these. isEmptyNN is a
> > single-atom method. isNotEmpty just replaces a ! sign etc etc.
>
> The Nots are very useful for these cases as they are so frequent.
>
> ---
> > Does anyone actually want isEmptyNN, or is it just that people are unhappy
> > with the null-handling in StringUtils? In which case I think the NN is the
> > wrong solution, we need to be thinking about an ability to create a
> > StringUtils with a strategy or having an underlying hidden class and 3
> > facade's for the different strategies. All 3.0.
>
> +1. Leave out NN for now. Its a bit of a hack.
>
> Stephen
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>


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


Re: [lang] Proposal (2): isEmpty

Posted by Stephen Colebourne <sc...@btopenworld.com>.
From: "Henri Yandell" <ba...@generationjava.com>
> > It isn't. My preference is now for
> >
> > isEmpty() - "" or null
> > isBlank() - whitespace only, "" or null
>
> Could just tell people to do isWhitespace && isEmpty  ? :)

I feel  isBlank() is more expressive than  isWhitespace(). It just feels
more inclusive of null and empty.

if (isNotBlank()) {
  ...process data
}
OR
if (isNotWhitespace()) {
  ...process data
}

Then again isWhitespace follows our naming definitions.

---
> > isEmptyTrimmed() - trim() then "" or null
>
> I'm not sure there's any need for this. I wonder how much of the chars
> less than 32 count as whitespace? But it seems that isWhitespace is for
> most people's usage a superset of isEmptyTrimmed.

Yeh, I'm happy to miss it out.

---
> > (plus isNotEmpty, isNotBlank, isEmptyNN, isBlankNN)
>
> Still hard to decide how far to go with all these. isEmptyNN is a
> single-atom method. isNotEmpty just replaces a ! sign etc etc.

The Nots are very useful for these cases as they are so frequent.

---
> Does anyone actually want isEmptyNN, or is it just that people are unhappy
> with the null-handling in StringUtils? In which case I think the NN is the
> wrong solution, we need to be thinking about an ability to create a
> StringUtils with a strategy or having an underlying hidden class and 3
> facade's for the different strategies. All 3.0.

+1. Leave out NN for now. Its a bit of a hack.

Stephen


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


Re: [lang] Proposal (2): isEmpty

Posted by Henri Yandell <ba...@generationjava.com>.

On Sat, 19 Jul 2003, Stephen Colebourne wrote:

> From: "Henri Yandell" <ba...@generationjava.com>
> > > Having just updated the whitespace processing, I now think that
> isBlank()
> > > should be fully Unicode compliant and trim using
> Character.isWhitespace()
> > > not String.trim().
> >
> > So how is it different from StringUtils.isWhitespace?
>
> It isn't. My preference is now for
>
> isEmpty() - "" or null
> isBlank() - whitespace only, "" or null

Could just tell people to do isWhitespace && isEmpty  ? :)

> and maybe:
> isEmptyTrimmed() - trim() then "" or null

I'm not sure there's any need for this. I wonder how much of the chars
less than 32 count as whitespace? But it seems that isWhitespace is for
most people's usage a superset of isEmptyTrimmed.

> (plus isNotEmpty, isNotBlank, isEmptyNN, isBlankNN)

Still hard to decide how far to go with all these. isEmptyNN is a
single-atom method. isNotEmpty just replaces a ! sign etc etc.

Does anyone actually want isEmptyNN, or is it just that people are unhappy
with the null-handling in StringUtils? In which case I think the NN is the
wrong solution, we need to be thinking about an ability to create a
StringUtils with a strategy or having an underlying hidden class and 3
facade's for the different strategies. All 3.0.

I think removing the trim from isEmpty is good, it's not expected by
users. I think the isEmpty-w/ trim people can just use isWhitespace [we
can javadoc them over].

Sorry to take so while to wake up on this,

Hen


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


Re: [lang] Proposal (2): isEmpty

Posted by Stephen Colebourne <sc...@btopenworld.com>.
From: "Henri Yandell" <ba...@generationjava.com>
> > Having just updated the whitespace processing, I now think that
isBlank()
> > should be fully Unicode compliant and trim using
Character.isWhitespace()
> > not String.trim().
>
> So how is it different from StringUtils.isWhitespace?

It isn't. My preference is now for

isEmpty() - "" or null
isBlank() - whitespace only, "" or null
and maybe:
isEmptyTrimmed() - trim() then "" or null

(plus isNotEmpty, isNotBlank, isEmptyNN, isBlankNN)

Stephen


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


Re: [lang] Proposal (2): isEmpty

Posted by Henri Yandell <ba...@generationjava.com>.

On Sat, 19 Jul 2003, Stephen Colebourne wrote:

> From: "Henri Yandell" <ba...@generationjava.com>
> > I wrote at least one of the isEmpty methods, and had no clue we'd moved to
> > using a trim() in there *whistle*. I admit it, I'm useless.
> >
> > I think the latest suggestion is a very good compromise.
>
> Having just updated the whitespace processing, I now think that isBlank()
> should be fully Unicode compliant and trim using Character.isWhitespace()
> not String.trim().

So how is it different from StringUtils.isWhitespace?

Hen


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


Re: [lang] Proposal (2): isEmpty

Posted by Stephen Colebourne <sc...@btopenworld.com>.
From: "Henri Yandell" <ba...@generationjava.com>
> I wrote at least one of the isEmpty methods, and had no clue we'd moved to
> using a trim() in there *whistle*. I admit it, I'm useless.
>
> I think the latest suggestion is a very good compromise.

Having just updated the whitespace processing, I now think that isBlank()
should be fully Unicode compliant and trim using Character.isWhitespace()
not String.trim().

tephen


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


Re: [lang] Proposal (2): isEmpty

Posted by Henri Yandell <ba...@generationjava.com>.

On Sat, 19 Jul 2003, Stephen Colebourne wrote:

> ----- Original Message -----
> From: "Todd Jonker" <tv...@pobox.com>
> > If we are changing the semantics of isEmpty  AT ALL, then any client code
> > will need to be altered in order for its operation to remain unchanged.
> > Which means the safest thing for all users to do, to guarantee that their
> > programs' behaviors are not changed, is to simply search-and-replace
> > "StringUtils.isEmpty(" with "StringUtils.isBlank("
>
> > In other words, is we are correcting isEmpty to not trim, we're not saving
> > anyone any work by keeping to true on null.
>
> Not necessarily. There is an indication that users are currently working
> under the assumption that isEmpty() does not trim. This appears to be the
> case for Tapestry and Turbine. Therefore, those users actually want the
> proposed change.

I wrote at least one of the isEmpty methods, and had no clue we'd moved to
using a trim() in there *whistle*. I admit it, I'm useless.

I think the latest suggestion is a very good compromise.

Hen


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


Re: [lang] Proposal (2): isEmpty

Posted by Stephen Colebourne <sc...@btopenworld.com>.
----- Original Message -----
From: "Todd Jonker" <tv...@pobox.com>
> If we are changing the semantics of isEmpty  AT ALL, then any client code
> will need to be altered in order for its operation to remain unchanged.
> Which means the safest thing for all users to do, to guarantee that their
> programs' behaviors are not changed, is to simply search-and-replace
> "StringUtils.isEmpty(" with "StringUtils.isBlank("

> In other words, is we are correcting isEmpty to not trim, we're not saving
> anyone any work by keeping to true on null.

Not necessarily. There is an indication that users are currently working
under the assumption that isEmpty() does not trim. This appears to be the
case for Tapestry and Turbine. Therefore, those users actually want the
proposed change.

-----
> Which to me implies that we might as well give isEmpty the correct
semantics
> relative to the standard, Sun-defined meaning of "empty".

You could argue the proposal is fixing isEmpty to Sun semantics. We're just
being null-friendly like the rest of StringUtils as well.

Also when I first came across [lang] I didn't expect isEmpty() to trim, but
I did expect null to be true (thats how my own utility codes it).

-----
> I still "vote" for Stephen's earlier proposal.  I don't mind the long
names
> because they are accurate and non-misleading, unlike the current names
(and
> some of those below).

Long names are accurate and  non-misleading I agree.  But they are user
unfriendly in typing terms and practical usage. The more I've thought about
this the more I want the short names and null true.

Stephen

>
> On 7/18/03 6:33 PM, scolebourne@btopenworld.com wrote:
>
> > Proposal for methods:
> >
> > - isEmpty() - true for "" or null
> > - isNotEmpty() - opposite
> > - isEmptyNN() - true for ""
> >
> > - isBlank() - trims - true for "  ", "" or null
> > - isNotBlank() - opposite
> > - isBlankNN() - trims - true for "  " or ""
> >
> > - isWhitespace() - true for all whitespace, "" or null
> > - isNotWhitespace() - opposite
> > - isWhitespaceNN() - true for all whitespace or ""
> >
> > Where NN means NotNull.
> > This covers all the cases, and takes the working premise that more
people
> > want null to be true than false.
> >
> >
> > Proposal for location:
> > 1) In StringUtils. Incompatable change to isEmpty() (no longer trims)
and
> > isWhitespace() (null now true).
> >
> > 2) In StringTests (new class). Deprecate StringUtils isEmpty/isNotEmpty.
> >
> >
> > I prefer the incompatable change #1. We are offering a simply named
> > alternative. Also, some people already don't expect isEmpty to trim. And
> > Tapestry and Turbine should both be OK.
> >
> > Stephen
> >
> > PS. If no agreement is forthcoming, then we shall have to revert to the
1.0
> > methods in order to get a release.
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
> >
> >
>
> --
>
> A patriot must always be ready to defend his country against its
> government.  -Edward Abbey, naturalist and author (1927-1989)
>
>     Defend our country!  Vote Howard Dean 2004
>         http://www.DeanForAmerica.com/
>         http://www.MoveOn.org/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>


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


Re: [lang] Proposal (2): isEmpty

Posted by Todd Jonker <tv...@pobox.com>.
If we are changing the semantics of isEmpty  AT ALL, then any client code
will need to be altered in order for its operation to remain unchanged.
Which means the safest thing for all users to do, to guarantee that their
programs' behaviors are not changed, is to simply search-and-replace
"StringUtils.isEmpty(" with "StringUtils.isBlank("

Which to me implies that we might as well give isEmpty the correct semantics
relative to the standard, Sun-defined meaning of "empty".

In other words, is we are correcting isEmpty to not trim, we're not saving
anyone any work by keeping to true on null.

I still "vote" for Stephen's earlier proposal.  I don't mind the long names
because they are accurate and non-misleading, unlike the current names (and
some of those below).


On 7/18/03 6:33 PM, scolebourne@btopenworld.com wrote:

> Proposal for methods:
> 
> - isEmpty() - true for "" or null
> - isNotEmpty() - opposite
> - isEmptyNN() - true for ""
> 
> - isBlank() - trims - true for "  ", "" or null
> - isNotBlank() - opposite
> - isBlankNN() - trims - true for "  " or ""
> 
> - isWhitespace() - true for all whitespace, "" or null
> - isNotWhitespace() - opposite
> - isWhitespaceNN() - true for all whitespace or ""
> 
> Where NN means NotNull.
> This covers all the cases, and takes the working premise that more people
> want null to be true than false.
> 
> 
> Proposal for location:
> 1) In StringUtils. Incompatable change to isEmpty() (no longer trims) and
> isWhitespace() (null now true).
> 
> 2) In StringTests (new class). Deprecate StringUtils isEmpty/isNotEmpty.
> 
> 
> I prefer the incompatable change #1. We are offering a simply named
> alternative. Also, some people already don't expect isEmpty to trim. And
> Tapestry and Turbine should both be OK.
> 
> Stephen
> 
> PS. If no agreement is forthcoming, then we shall have to revert to the 1.0
> methods in order to get a release.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> 
> 

-- 

A patriot must always be ready to defend his country against its
government.  -Edward Abbey, naturalist and author (1927-1989)

    Defend our country!  Vote Howard Dean 2004
        http://www.DeanForAmerica.com/
        http://www.MoveOn.org/


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


Re: [lang] Proposal (2): isEmpty

Posted by Henri Yandell <ba...@generationjava.com>.

On Fri, 18 Jul 2003, Lavandowska wrote:

> I could live with #1, though I'd rather the current contract (the
> trim() functionality) didn't change (whine whine whine).

isBlank! Just think of the joy you'll have as you switch to it. It's such
a sexier name.

> Or #2 is fine also, but I'd suggest another name (StringTests connotes
> Unit tests to me), maybe StringChecks or CheckString?

2004!


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


Re: [lang] Proposal (2): isEmpty

Posted by Lavandowska <fl...@yahoo.com>.
I could live with #1, though I'd rather the current contract (the
trim() functionality) didn't change (whine whine whine).

Or #2 is fine also, but I'd suggest another name (StringTests connotes
Unit tests to me), maybe StringChecks or CheckString?

Lance

--- Stephen Colebourne <sc...@btopenworld.com> wrote:
> Proposal for methods:
> 
> - isEmpty() - true for "" or null
> - isNotEmpty() - opposite
> - isEmptyNN() - true for ""
> 
> - isBlank() - trims - true for "  ", "" or null
> - isNotBlank() - opposite
> - isBlankNN() - trims - true for "  " or ""
> 
> - isWhitespace() - true for all whitespace, "" or null
> - isNotWhitespace() - opposite
> - isWhitespaceNN() - true for all whitespace or ""
> 
> Where NN means NotNull.
> This covers all the cases, and takes the working premise that more
> people want null to be true than false.
> 
> 
> Proposal for location:
> 1) In StringUtils. Incompatable change to isEmpty() (no longer trims)
> and
> isWhitespace() (null now true).
> 
> 2) In StringTests (new class). Deprecate StringUtils
> isEmpty/isNotEmpty.


=====
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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


RE: [lang] Proposal (2): isEmpty

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
(I've switched my subscription over from digest back to full so I don't miss these).

Thanks for re-posting this.  I can see that this change will not affect me; if there are any places
where the difference between isEmpty() and isBlank() will affect me, my test suite should find them.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry



> -----Original Message-----
> From: Stephen Colebourne [mailto:scolebourne@btopenworld.com] 
> Sent: Friday, July 18, 2003 6:33 PM
> To: Jakarta Commons Developers List
> Subject: [lang] Proposal (2): isEmpty
> 
> 
> Proposal for methods:
> 
> - isEmpty() - true for "" or null
> - isNotEmpty() - opposite
> - isEmptyNN() - true for ""
> 
> - isBlank() - trims - true for "  ", "" or null
> - isNotBlank() - opposite
> - isBlankNN() - trims - true for "  " or ""
> 
> - isWhitespace() - true for all whitespace, "" or null
> - isNotWhitespace() - opposite
> - isWhitespaceNN() - true for all whitespace or ""
> 
> Where NN means NotNull.
> This covers all the cases, and takes the working premise that 
> more people want null to be true than false.
> 
> 
> Proposal for location:
> 1) In StringUtils. Incompatable change to isEmpty() (no 
> longer trims) and
> isWhitespace() (null now true).
> 
> 2) In StringTests (new class). Deprecate StringUtils 
> isEmpty/isNotEmpty.
> 
> 
> I prefer the incompatable change #1. We are offering a simply 
> named alternative. Also, some people already don't expect 
> isEmpty to trim. And Tapestry and Turbine should both be OK.
> 
> Stephen
> 
> PS. If no agreement is forthcoming, then we shall have to 
> revert to the 1.0 methods in order to get a release.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


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