To preserve compatibility with old implementation of parseStringArray()

and to generally behave properly, we return a zero-length array if we are
supplied with a zero-length string.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@568 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2002-02-08 09:35:45 +00:00
parent d5fb2fe6b1
commit 1f30a21f1b
@@ -1,5 +1,5 @@
//
// $Id: StringUtil.java,v 1.28 2002/02/07 08:41:59 mdb Exp $
// $Id: StringUtil.java,v 1.29 2002/02/08 09:35:45 mdb Exp $
//
// samskivert library - useful routines for java programs
// Copyright (C) 2001 Michael Bayne
@@ -415,6 +415,11 @@ public class StringUtil
{
int tcount = 0, tpos = -1, tstart = 0;
// empty strings result in zero length arrays
if (source.length() == 0) {
return new String[0];
}
// sort out escaped commas
source = replace(source, ",,", "%COMMA%");