Accept "t" for true in parseBooleanArray, since that's what

toString(boolean[]) emits.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2320 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
andrzej
2008-06-05 02:43:33 +00:00
parent 0769979b03
commit e0a4516eaf
+3 -2
View File
@@ -973,8 +973,9 @@ public class StringUtil
StringTokenizer tok = new StringTokenizer(source, ",");
boolean[] vals = new boolean[tok.countTokens()];
for (int i = 0; tok.hasMoreTokens(); i++) {
// trim the whitespace from the token
vals[i] = Boolean.parseBoolean(tok.nextToken().trim());
// accept a lone 't' for true for compatibility with toString(boolean[])
String token = tok.nextToken().trim();
vals[i] = Boolean.parseBoolean(token) || token.equalsIgnoreCase("t");
}
return vals;
}