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/17 02:02:47 UTC

[lang] Pre 2.0 StringUtils NPE changes

I have done most of these. Still do do:
strip methods
case changing methods
reverseDelimited()

Currently the CVS tests do not pass. This is because the leftPad and
rightPad methods don't work properly (as I see it) - I tightened the tests.

Unfortunately I'm not going to be able to do anything until Fri eve GMT.
Anyone can feel free to fix the bug! Or sort out the null handling...

Stephen


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


Re: [lang] Pre 2.0 StringUtils NPE changes

Posted by Stephen Colebourne <sc...@btopenworld.com>.
NPE changes are done. All StringUtils now handles null consistently and
quietly.

Problems remaining pre 2.0:
- leftPad/rightPad/center - leftPad("abc", 4, "yz") gives "abc", whereas I
would expect "yabc"

- split documents using whitespace, but actually uses StringTokenizer which
uses Character.isSpace()

- defaultString(Object) should be in ObjectUtils, not in StringUtils

- some more example code comments to add

- double check classes other than StringUtils for same issues

Stephen


----- Original Message -----
From: "Stephen Colebourne" <sc...@btopenworld.com>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
Sent: Thursday, July 17, 2003 1:02 AM
Subject: [lang] Pre 2.0 StringUtils NPE changes


> I have done most of these. Still do do:
> strip methods
> case changing methods
> reverseDelimited()
>
> Currently the CVS tests do not pass. This is because the leftPad and
> rightPad methods don't work properly (as I see it) - I tightened the
tests.
>
> Unfortunately I'm not going to be able to do anything until Fri eve GMT.
> Anyone can feel free to fix the bug! Or sort out the null handling...
>
> 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] Pre 2.0 StringUtils NPE changes

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Howard M. Lewis Ship" <hl...@comcast.net> writes:

>I must have missed this.  What change to StringUtils.isEmpty() are you making.  I like it just the
>way it it ... I had an identical method in Tapestry that I deprecated and pointed at StringUtils.
>I'm very much reliant on "" == null.

I strongly agree here! We replaced lots and lots of

if ((foo == null) || foo.equals(""))   with StringUtils.isEmpty()

if ((foo != null) && !foo.equals("")) with StringUtils.isNotEmpty()

in Turbine. If you change this behaviour, we would get _very_
upset... :-)

	Regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

Java, perl, Solaris, Linux, xSP Consulting, Web Services 
freelance consultant -- Jakarta Turbine Development  -- hero for hire

--- Quote of the week: "It is pointless to tell people anything when
you know that they won't process the message." --- Jonathan Revusky

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


RE: [lang] Pre 2.0 StringUtils NPE changes

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
I must have missed this.  What change to StringUtils.isEmpty() are you making.  I like it just the
way it it ... I had an identical method in Tapestry that I deprecated and pointed at StringUtils.
I'm very much reliant on "" == null.

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



> -----Original Message-----
> From: Stephen Colebourne [mailto:scolebourne@btopenworld.com] 
> Sent: Wednesday, July 16, 2003 8:03 PM
> To: Jakarta Commons Developers List
> Subject: [lang] Pre 2.0 StringUtils NPE changes
> 
> 
> I have done most of these. Still do do:
> strip methods
> case changing methods
> reverseDelimited()
> 
> Currently the CVS tests do not pass. This is because the 
> leftPad and rightPad methods don't work properly (as I see 
> it) - I tightened the tests.
> 
> Unfortunately I'm not going to be able to do anything until 
> Fri eve GMT. Anyone can feel free to fix the bug! Or sort out 
> the null handling...
> 
> Stephen
> 
> 


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