Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4764F10272 for ; Thu, 17 Oct 2013 06:21:44 +0000 (UTC) Received: (qmail 58218 invoked by uid 500); 17 Oct 2013 06:20:44 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 57992 invoked by uid 500); 17 Oct 2013 06:20:37 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 57618 invoked by uid 99); 17 Oct 2013 06:20:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Oct 2013 06:20:25 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Oct 2013 06:20:20 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 332522388CB4 for ; Thu, 17 Oct 2013 06:19:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r882935 [29/37] - in /websites/production/commons/content/proper/commons-lang: ./ apidocs/ apidocs/org/apache/commons/lang3/ apidocs/org/apache/commons/lang3/reflect/ apidocs/org/apache/commons/lang3/time/ apidocs/src-html/org/apache/common... Date: Thu, 17 Oct 2013 06:18:48 -0000 To: commits@commons.apache.org From: bayard@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131017061903.332522388CB4@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: websites/production/commons/content/proper/commons-lang/testapidocs/src-html/org/apache/commons/lang3/StringUtilsTest.html ============================================================================== --- websites/production/commons/content/proper/commons-lang/testapidocs/src-html/org/apache/commons/lang3/StringUtilsTest.html (original) +++ websites/production/commons/content/proper/commons-lang/testapidocs/src-html/org/apache/commons/lang3/StringUtilsTest.html Thu Oct 17 06:18:45 2013 @@ -44,2291 +44,2295 @@ 041 /** 042 * Unit tests {@link org.apache.commons.lang3.StringUtils}. 043 * -044 * @version $Id: StringUtilsTest.java 1497829 2013-06-28 16:21:09Z brentworden $ +044 * @version $Id: StringUtilsTest.java 1531643 2013-10-13 09:02:07Z bayard $ 045 */ 046 public class StringUtilsTest { 047 048 static final String WHITESPACE; 049 static final String NON_WHITESPACE; -050 static final String TRIMMABLE; -051 static final String NON_TRIMMABLE; -052 static { -053 String ws = ""; -054 String nws = ""; -055 String tr = ""; -056 String ntr = ""; -057 for (int i = 0; i < Character.MAX_VALUE; i++) { -058 if (Character.isWhitespace((char) i)) { -059 ws += String.valueOf((char) i); -060 if (i > 32) { -061 ntr += String.valueOf((char) i); -062 } -063 } else if (i < 40) { -064 nws += String.valueOf((char) i); -065 } -066 } -067 for (int i = 0; i <= 32; i++) { -068 tr += String.valueOf((char) i); -069 } -070 WHITESPACE = ws; -071 NON_WHITESPACE = nws; -072 TRIMMABLE = tr; -073 NON_TRIMMABLE = ntr; -074 } -075 -076 private static final String[] ARRAY_LIST = { "foo", "bar", "baz" }; -077 private static final String[] EMPTY_ARRAY_LIST = {}; -078 private static final String[] NULL_ARRAY_LIST = {null}; -079 private static final Object[] NULL_TO_STRING_LIST = { -080 new Object(){ -081 @Override -082 public String toString() { -083 return null; -084 } -085 } -086 }; -087 private static final String[] MIXED_ARRAY_LIST = {null, "", "foo"}; -088 private static final Object[] MIXED_TYPE_LIST = {"foo", Long.valueOf(2L)}; -089 private static final long[] LONG_PRIM_LIST = {1, 2}; -090 private static final int[] INT_PRIM_LIST = {1, 2}; -091 private static final byte[] BYTE_PRIM_LIST = {1, 2}; -092 private static final short[] SHORT_PRIM_LIST = {1, 2}; -093 private static final char[] CHAR_PRIM_LIST = {'1', '2'}; -094 private static final float[] FLOAT_PRIM_LIST = {1, 2}; -095 private static final double[] DOUBLE_PRIM_LIST = {1, 2}; -096 -097 private static final String SEPARATOR = ","; -098 private static final char SEPARATOR_CHAR = ';'; +050 static final String HARD_SPACE; +051 static final String TRIMMABLE; +052 static final String NON_TRIMMABLE; +053 static { +054 String ws = ""; +055 String nws = ""; +056 String hs = String.valueOf(((char) 160)); +057 String tr = ""; +058 String ntr = ""; +059 for (int i = 0; i < Character.MAX_VALUE; i++) { +060 if (Character.isWhitespace((char) i)) { +061 ws += String.valueOf((char) i); +062 if (i > 32) { +063 ntr += String.valueOf((char) i); +064 } +065 } else if (i < 40) { +066 nws += String.valueOf((char) i); +067 } +068 } +069 for (int i = 0; i <= 32; i++) { +070 tr += String.valueOf((char) i); +071 } +072 WHITESPACE = ws; +073 NON_WHITESPACE = nws; +074 HARD_SPACE = hs; +075 TRIMMABLE = tr; +076 NON_TRIMMABLE = ntr; +077 } +078 +079 private static final String[] ARRAY_LIST = { "foo", "bar", "baz" }; +080 private static final String[] EMPTY_ARRAY_LIST = {}; +081 private static final String[] NULL_ARRAY_LIST = {null}; +082 private static final Object[] NULL_TO_STRING_LIST = { +083 new Object(){ +084 @Override +085 public String toString() { +086 return null; +087 } +088 } +089 }; +090 private static final String[] MIXED_ARRAY_LIST = {null, "", "foo"}; +091 private static final Object[] MIXED_TYPE_LIST = {"foo", Long.valueOf(2L)}; +092 private static final long[] LONG_PRIM_LIST = {1, 2}; +093 private static final int[] INT_PRIM_LIST = {1, 2}; +094 private static final byte[] BYTE_PRIM_LIST = {1, 2}; +095 private static final short[] SHORT_PRIM_LIST = {1, 2}; +096 private static final char[] CHAR_PRIM_LIST = {'1', '2'}; +097 private static final float[] FLOAT_PRIM_LIST = {1, 2}; +098 private static final double[] DOUBLE_PRIM_LIST = {1, 2}; 099 -100 private static final String TEXT_LIST = "foo,bar,baz"; -101 private static final String TEXT_LIST_CHAR = "foo;bar;baz"; -102 private static final String TEXT_LIST_NOSEP = "foobarbaz"; -103 -104 private static final String FOO_UNCAP = "foo"; -105 private static final String FOO_CAP = "Foo"; +100 private static final String SEPARATOR = ","; +101 private static final char SEPARATOR_CHAR = ';'; +102 +103 private static final String TEXT_LIST = "foo,bar,baz"; +104 private static final String TEXT_LIST_CHAR = "foo;bar;baz"; +105 private static final String TEXT_LIST_NOSEP = "foobarbaz"; 106 -107 private static final String SENTENCE_UNCAP = "foo bar baz"; -108 private static final String SENTENCE_CAP = "Foo Bar Baz"; +107 private static final String FOO_UNCAP = "foo"; +108 private static final String FOO_CAP = "Foo"; 109 -110 //----------------------------------------------------------------------- -111 @Test -112 public void testConstructor() { -113 assertNotNull(new StringUtils()); -114 final Constructor<?>[] cons = StringUtils.class.getDeclaredConstructors(); -115 assertEquals(1, cons.length); -116 assertTrue(Modifier.isPublic(cons[0].getModifiers())); -117 assertTrue(Modifier.isPublic(StringUtils.class.getModifiers())); -118 assertFalse(Modifier.isFinal(StringUtils.class.getModifiers())); -119 } -120 -121 //----------------------------------------------------------------------- -122 @Test -123 public void testCaseFunctions() { -124 assertEquals(null, StringUtils.upperCase(null)); -125 assertEquals(null, StringUtils.upperCase(null, Locale.ENGLISH)); -126 assertEquals(null, StringUtils.lowerCase(null)); -127 assertEquals(null, StringUtils.lowerCase(null, Locale.ENGLISH)); -128 assertEquals(null, StringUtils.capitalize(null)); -129 assertEquals(null, StringUtils.uncapitalize(null)); -130 -131 assertEquals("capitalize(empty-string) failed", -132 "", StringUtils.capitalize("") ); -133 assertEquals("capitalize(single-char-string) failed", -134 "X", StringUtils.capitalize("x") ); -135 assertEquals("capitalize(String) failed", -136 FOO_CAP, StringUtils.capitalize(FOO_CAP) ); -137 assertEquals("capitalize(string) failed", -138 FOO_CAP, StringUtils.capitalize(FOO_UNCAP) ); -139 -140 assertEquals("uncapitalize(String) failed", -141 FOO_UNCAP, StringUtils.uncapitalize(FOO_CAP) ); -142 assertEquals("uncapitalize(string) failed", -143 FOO_UNCAP, StringUtils.uncapitalize(FOO_UNCAP) ); -144 assertEquals("uncapitalize(empty-string) failed", -145 "", StringUtils.uncapitalize("") ); -146 assertEquals("uncapitalize(single-char-string) failed", -147 "x", StringUtils.uncapitalize("X") ); -148 -149 // reflection type of tests: Sentences. -150 assertEquals("uncapitalize(capitalize(String)) failed", -151 SENTENCE_UNCAP, StringUtils.uncapitalize(StringUtils.capitalize(SENTENCE_UNCAP)) ); -152 assertEquals("capitalize(uncapitalize(String)) failed", -153 SENTENCE_CAP, StringUtils.capitalize(StringUtils.uncapitalize(SENTENCE_CAP)) ); -154 -155 // reflection type of tests: One word. -156 assertEquals("uncapitalize(capitalize(String)) failed", -157 FOO_UNCAP, StringUtils.uncapitalize(StringUtils.capitalize(FOO_UNCAP)) ); -158 assertEquals("capitalize(uncapitalize(String)) failed", -159 FOO_CAP, StringUtils.capitalize(StringUtils.uncapitalize(FOO_CAP)) ); -160 -161 assertEquals("upperCase(String) failed", -162 "FOO TEST THING", StringUtils.upperCase("fOo test THING") ); -163 assertEquals("upperCase(empty-string) failed", -164 "", StringUtils.upperCase("") ); -165 assertEquals("lowerCase(String) failed", -166 "foo test thing", StringUtils.lowerCase("fOo test THING") ); -167 assertEquals("lowerCase(empty-string) failed", -168 "", StringUtils.lowerCase("") ); -169 -170 assertEquals("upperCase(String, Locale) failed", -171 "FOO TEST THING", StringUtils.upperCase("fOo test THING", Locale.ENGLISH) ); -172 assertEquals("upperCase(empty-string, Locale) failed", -173 "", StringUtils.upperCase("", Locale.ENGLISH) ); -174 assertEquals("lowerCase(String, Locale) failed", -175 "foo test thing", StringUtils.lowerCase("fOo test THING", Locale.ENGLISH) ); -176 assertEquals("lowerCase(empty-string, Locale) failed", -177 "", StringUtils.lowerCase("", Locale.ENGLISH) ); -178 } -179 -180 @Test -181 public void testSwapCase_String() { -182 assertEquals(null, StringUtils.swapCase(null)); -183 assertEquals("", StringUtils.swapCase("")); -184 assertEquals(" ", StringUtils.swapCase(" ")); -185 -186 assertEquals("i", WordUtils.swapCase("I") ); -187 assertEquals("I", WordUtils.swapCase("i") ); -188 assertEquals("I AM HERE 123", StringUtils.swapCase("i am here 123") ); -189 assertEquals("i aM hERE 123", StringUtils.swapCase("I Am Here 123") ); -190 assertEquals("I AM here 123", StringUtils.swapCase("i am HERE 123") ); -191 assertEquals("i am here 123", StringUtils.swapCase("I AM HERE 123") ); -192 -193 final String test = "This String contains a TitleCase character: \u01C8"; -194 final String expect = "tHIS sTRING CONTAINS A tITLEcASE CHARACTER: \u01C9"; -195 assertEquals(expect, WordUtils.swapCase(test)); -196 } -197 -198 //----------------------------------------------------------------------- -199 @Test -200 public void testJoin_Objects() { -201 assertEquals("abc", StringUtils.join("a", "b", "c")); -202 assertEquals("a", StringUtils.join(null, "", "a")); -203 assertEquals(null, StringUtils.join((Object[])null)); -204 } -205 -206 @Test -207 public void testJoin_Objectarray() { -208 // assertEquals(null, StringUtils.join(null)); // generates warning -209 assertEquals(null, StringUtils.join((Object[]) null)); // equivalent explicit cast -210 // test additional varargs calls -211 assertEquals("", StringUtils.join()); // empty array -212 assertEquals("", StringUtils.join((Object) null)); // => new Object[]{null} -213 -214 assertEquals("", StringUtils.join(EMPTY_ARRAY_LIST)); -215 assertEquals("", StringUtils.join(NULL_ARRAY_LIST)); -216 assertEquals("null", StringUtils.join(NULL_TO_STRING_LIST)); -217 assertEquals("abc", StringUtils.join(new String[] {"a", "b", "c"})); -218 assertEquals("a", StringUtils.join(new String[] {null, "a", ""})); -219 assertEquals("foo", StringUtils.join(MIXED_ARRAY_LIST)); -220 assertEquals("foo2", StringUtils.join(MIXED_TYPE_LIST)); -221 } -222 -223 @Test -224 public void testJoin_ArrayCharSeparator() { -225 assertEquals(null, StringUtils.join((Object[]) null, ',')); -226 assertEquals(TEXT_LIST_CHAR, StringUtils.join(ARRAY_LIST, SEPARATOR_CHAR)); -227 assertEquals("", StringUtils.join(EMPTY_ARRAY_LIST, SEPARATOR_CHAR)); -228 assertEquals(";;foo", StringUtils.join(MIXED_ARRAY_LIST, SEPARATOR_CHAR)); -229 assertEquals("foo;2", StringUtils.join(MIXED_TYPE_LIST, SEPARATOR_CHAR)); -230 -231 assertEquals("/", StringUtils.join(MIXED_ARRAY_LIST, '/', 0, MIXED_ARRAY_LIST.length-1)); -232 assertEquals("foo", StringUtils.join(MIXED_TYPE_LIST, '/', 0, 1)); -233 assertEquals("null", StringUtils.join(NULL_TO_STRING_LIST,'/', 0, 1)); -234 assertEquals("foo/2", StringUtils.join(MIXED_TYPE_LIST, '/', 0, 2)); -235 assertEquals("2", StringUtils.join(MIXED_TYPE_LIST, '/', 1, 2)); -236 assertEquals("", StringUtils.join(MIXED_TYPE_LIST, '/', 2, 1)); -237 } -238 -239 @Test -240 public void testJoin_ArrayOfChars() { -241 assertEquals(null, StringUtils.join((char[]) null, ',')); -242 assertEquals("1;2", StringUtils.join(CHAR_PRIM_LIST, SEPARATOR_CHAR)); -243 assertEquals("2", StringUtils.join(CHAR_PRIM_LIST, SEPARATOR_CHAR, 1, 2)); -244 } -245 -246 @Test -247 public void testJoin_ArrayOfBytes() { -248 assertEquals(null, StringUtils.join((byte[]) null, ',')); -249 assertEquals("1;2", StringUtils.join(BYTE_PRIM_LIST, SEPARATOR_CHAR)); -250 assertEquals("2", StringUtils.join(BYTE_PRIM_LIST, SEPARATOR_CHAR, 1, 2)); -251 } -252 -253 @Test -254 public void testJoin_ArrayOfInts() { -255 assertEquals(null, StringUtils.join((int[]) null, ',')); -256 assertEquals("1;2", StringUtils.join(INT_PRIM_LIST, SEPARATOR_CHAR)); -257 assertEquals("2", StringUtils.join(INT_PRIM_LIST, SEPARATOR_CHAR, 1, 2)); -258 } -259 -260 @Test -261 public void testJoin_ArrayOfLongs() { -262 assertEquals(null, StringUtils.join((long[]) null, ',')); -263 assertEquals("1;2", StringUtils.join(LONG_PRIM_LIST, SEPARATOR_CHAR)); -264 assertEquals("2", StringUtils.join(LONG_PRIM_LIST, SEPARATOR_CHAR, 1, 2)); -265 } -266 -267 @Test -268 public void testJoin_ArrayOfFloats() { -269 assertEquals(null, StringUtils.join((float[]) null, ',')); -270 assertEquals("1.0;2.0", StringUtils.join(FLOAT_PRIM_LIST, SEPARATOR_CHAR)); -271 assertEquals("2.0", StringUtils.join(FLOAT_PRIM_LIST, SEPARATOR_CHAR, 1, 2)); -272 } -273 -274 @Test -275 public void testJoin_ArrayOfDoubles() { -276 assertEquals(null, StringUtils.join((double[]) null, ',')); -277 assertEquals("1.0;2.0", StringUtils.join(DOUBLE_PRIM_LIST, SEPARATOR_CHAR)); -278 assertEquals("2.0", StringUtils.join(DOUBLE_PRIM_LIST, SEPARATOR_CHAR, 1, 2)); -279 } -280 -281 @Test -282 public void testJoin_ArrayOfShorts() { -283 assertEquals(null, StringUtils.join((short[]) null, ',')); -284 assertEquals("1;2", StringUtils.join(SHORT_PRIM_LIST, SEPARATOR_CHAR)); -285 assertEquals("2", StringUtils.join(SHORT_PRIM_LIST, SEPARATOR_CHAR, 1, 2)); -286 } -287 -288 @Test -289 public void testJoin_ArrayString() { -290 assertEquals(null, StringUtils.join((Object[]) null, null)); -291 assertEquals(TEXT_LIST_NOSEP, StringUtils.join(ARRAY_LIST, null)); -292 assertEquals(TEXT_LIST_NOSEP, StringUtils.join(ARRAY_LIST, "")); -293 -294 assertEquals("", StringUtils.join(NULL_ARRAY_LIST, null)); -295 -296 assertEquals("", StringUtils.join(EMPTY_ARRAY_LIST, null)); -297 assertEquals("", StringUtils.join(EMPTY_ARRAY_LIST, "")); -298 assertEquals("", StringUtils.join(EMPTY_ARRAY_LIST, SEPARATOR)); -299 -300 assertEquals(TEXT_LIST, StringUtils.join(ARRAY_LIST, SEPARATOR)); -301 assertEquals(",,foo", StringUtils.join(MIXED_ARRAY_LIST, SEPARATOR)); -302 assertEquals("foo,2", StringUtils.join(MIXED_TYPE_LIST, SEPARATOR)); -303 -304 assertEquals("/", StringUtils.join(MIXED_ARRAY_LIST, "/", 0, MIXED_ARRAY_LIST.length-1)); -305 assertEquals("", StringUtils.join(MIXED_ARRAY_LIST, "", 0, MIXED_ARRAY_LIST.length-1)); -306 assertEquals("foo", StringUtils.join(MIXED_TYPE_LIST, "/", 0, 1)); -307 assertEquals("foo/2", StringUtils.join(MIXED_TYPE_LIST, "/", 0, 2)); -308 assertEquals("2", StringUtils.join(MIXED_TYPE_LIST, "/", 1, 2)); -309 assertEquals("", StringUtils.join(MIXED_TYPE_LIST, "/", 2, 1)); -310 } -311 -312 @Test -313 public void testJoin_IteratorChar() { -314 assertEquals(null, StringUtils.join((Iterator<?>) null, ',')); -315 assertEquals(TEXT_LIST_CHAR, StringUtils.join(Arrays.asList(ARRAY_LIST).iterator(), SEPARATOR_CHAR)); -316 assertEquals("", StringUtils.join(Arrays.asList(NULL_ARRAY_LIST).iterator(), SEPARATOR_CHAR)); -317 assertEquals("", StringUtils.join(Arrays.asList(EMPTY_ARRAY_LIST).iterator(), SEPARATOR_CHAR)); -318 assertEquals("foo", StringUtils.join(Collections.singleton("foo").iterator(), 'x')); -319 } -320 -321 @Test -322 public void testJoin_IteratorString() { -323 assertEquals(null, StringUtils.join((Iterator<?>) null, null)); -324 assertEquals(TEXT_LIST_NOSEP, StringUtils.join(Arrays.asList(ARRAY_LIST).iterator(), null)); -325 assertEquals(TEXT_LIST_NOSEP, StringUtils.join(Arrays.asList(ARRAY_LIST).iterator(), "")); -326 assertEquals("foo", StringUtils.join(Collections.singleton("foo").iterator(), "x")); -327 assertEquals("foo", StringUtils.join(Collections.singleton("foo").iterator(), null)); -328 -329 assertEquals("", StringUtils.join(Arrays.asList(NULL_ARRAY_LIST).iterator(), null)); -330 -331 assertEquals("", StringUtils.join(Arrays.asList(EMPTY_ARRAY_LIST).iterator(), null)); -332 assertEquals("", StringUtils.join(Arrays.asList(EMPTY_ARRAY_LIST).iterator(), "")); -333 assertEquals("", StringUtils.join(Arrays.asList(EMPTY_ARRAY_LIST).iterator(), SEPARATOR)); -334 -335 assertEquals(TEXT_LIST, StringUtils.join(Arrays.asList(ARRAY_LIST).iterator(), SEPARATOR)); -336 } -337 -338 @Test -339 public void testJoin_IterableChar() { -340 assertEquals(null, StringUtils.join((Iterable<?>) null, ',')); -341 assertEquals(TEXT_LIST_CHAR, StringUtils.join(Arrays.asList(ARRAY_LIST), SEPARATOR_CHAR)); -342 assertEquals("", StringUtils.join(Arrays.asList(NULL_ARRAY_LIST), SEPARATOR_CHAR)); -343 assertEquals("", StringUtils.join(Arrays.asList(EMPTY_ARRAY_LIST), SEPARATOR_CHAR)); -344 assertEquals("foo", StringUtils.join(Collections.singleton("foo"), 'x')); -345 } -346 -347 @Test -348 public void testJoin_IterableString() { -349 assertEquals(null, StringUtils.join((Iterable<?>) null, null)); -350 assertEquals(TEXT_LIST_NOSEP, StringUtils.join(Arrays.asList(ARRAY_LIST), null)); -351 assertEquals(TEXT_LIST_NOSEP, StringUtils.join(Arrays.asList(ARRAY_LIST), "")); -352 assertEquals("foo", StringUtils.join(Collections.singleton("foo"), "x")); -353 assertEquals("foo", StringUtils.join(Collections.singleton("foo"), null)); -354 -355 assertEquals("", StringUtils.join(Arrays.asList(NULL_ARRAY_LIST), null)); -356 -357 assertEquals("", StringUtils.join(Arrays.asList(EMPTY_ARRAY_LIST), null)); -358 assertEquals("", StringUtils.join(Arrays.asList(EMPTY_ARRAY_LIST), "")); -359 assertEquals("", StringUtils.join(Arrays.asList(EMPTY_ARRAY_LIST), SEPARATOR)); -360 -361 assertEquals(TEXT_LIST, StringUtils.join(Arrays.asList(ARRAY_LIST), SEPARATOR)); -362 } +110 private static final String SENTENCE_UNCAP = "foo bar baz"; +111 private static final String SENTENCE_CAP = "Foo Bar Baz"; +112 +113 //----------------------------------------------------------------------- +114 @Test +115 public void testConstructor() { +116 assertNotNull(new StringUtils()); +117 final Constructor<?>[] cons = StringUtils.class.getDeclaredConstructors(); +118 assertEquals(1, cons.length); +119 assertTrue(Modifier.isPublic(cons[0].getModifiers())); +120 assertTrue(Modifier.isPublic(StringUtils.class.getModifiers())); +121 assertFalse(Modifier.isFinal(StringUtils.class.getModifiers())); +122 } +123 +124 //----------------------------------------------------------------------- +125 @Test +126 public void testCaseFunctions() { +127 assertEquals(null, StringUtils.upperCase(null)); +128 assertEquals(null, StringUtils.upperCase(null, Locale.ENGLISH)); +129 assertEquals(null, StringUtils.lowerCase(null)); +130 assertEquals(null, StringUtils.lowerCase(null, Locale.ENGLISH)); +131 assertEquals(null, StringUtils.capitalize(null)); +132 assertEquals(null, StringUtils.uncapitalize(null)); +133 +134 assertEquals("capitalize(empty-string) failed", +135 "", StringUtils.capitalize("") ); +136 assertEquals("capitalize(single-char-string) failed", +137 "X", StringUtils.capitalize("x") ); +138 assertEquals("capitalize(String) failed", +139 FOO_CAP, StringUtils.capitalize(FOO_CAP) ); +140 assertEquals("capitalize(string) failed", +141 FOO_CAP, StringUtils.capitalize(FOO_UNCAP) ); +142 +143 assertEquals("uncapitalize(String) failed", +144 FOO_UNCAP, StringUtils.uncapitalize(FOO_CAP) ); +145 assertEquals("uncapitalize(string) failed", +146 FOO_UNCAP, StringUtils.uncapitalize(FOO_UNCAP) ); +147 assertEquals("uncapitalize(empty-string) failed", +148 "", StringUtils.uncapitalize("") ); +149 assertEquals("uncapitalize(single-char-string) failed", +150 "x", StringUtils.uncapitalize("X") ); +151 +152 // reflection type of tests: Sentences. +153 assertEquals("uncapitalize(capitalize(String)) failed", +154 SENTENCE_UNCAP, StringUtils.uncapitalize(StringUtils.capitalize(SENTENCE_UNCAP)) ); +155 assertEquals("capitalize(uncapitalize(String)) failed", +156 SENTENCE_CAP, StringUtils.capitalize(StringUtils.uncapitalize(SENTENCE_CAP)) ); +157 +158 // reflection type of tests: One word. +159 assertEquals("uncapitalize(capitalize(String)) failed", +160 FOO_UNCAP, StringUtils.uncapitalize(StringUtils.capitalize(FOO_UNCAP)) ); +161 assertEquals("capitalize(uncapitalize(String)) failed", +162 FOO_CAP, StringUtils.capitalize(StringUtils.uncapitalize(FOO_CAP)) ); +163 +164 assertEquals("upperCase(String) failed", +165 "FOO TEST THING", StringUtils.upperCase("fOo test THING") ); +166 assertEquals("upperCase(empty-string) failed", +167 "", StringUtils.upperCase("") ); +168 assertEquals("lowerCase(String) failed", +169 "foo test thing", StringUtils.lowerCase("fOo test THING") ); +170 assertEquals("lowerCase(empty-string) failed", +171 "", StringUtils.lowerCase("") ); +172 +173 assertEquals("upperCase(String, Locale) failed", +174 "FOO TEST THING", StringUtils.upperCase("fOo test THING", Locale.ENGLISH) ); +175 assertEquals("upperCase(empty-string, Locale) failed", +176 "", StringUtils.upperCase("", Locale.ENGLISH) ); +177 assertEquals("lowerCase(String, Locale) failed", +178 "foo test thing", StringUtils.lowerCase("fOo test THING", Locale.ENGLISH) ); +179 assertEquals("lowerCase(empty-string, Locale) failed", +180 "", StringUtils.lowerCase("", Locale.ENGLISH) ); +181 } +182 +183 @Test +184 public void testSwapCase_String() { +185 assertEquals(null, StringUtils.swapCase(null)); +186 assertEquals("", StringUtils.swapCase("")); +187 assertEquals(" ", StringUtils.swapCase(" ")); +188 +189 assertEquals("i", WordUtils.swapCase("I") ); +190 assertEquals("I", WordUtils.swapCase("i") ); +191 assertEquals("I AM HERE 123", StringUtils.swapCase("i am here 123") ); +192 assertEquals("i aM hERE 123", StringUtils.swapCase("I Am Here 123") ); +193 assertEquals("I AM here 123", StringUtils.swapCase("i am HERE 123") ); +194 assertEquals("i am here 123", StringUtils.swapCase("I AM HERE 123") ); +195 +196 final String test = "This String contains a TitleCase character: \u01C8"; +197 final String expect = "tHIS sTRING CONTAINS A tITLEcASE CHARACTER: \u01C9"; +198 assertEquals(expect, WordUtils.swapCase(test)); +199 } +200 +201 //----------------------------------------------------------------------- +202 @Test +203 public void testJoin_Objects() { +204 assertEquals("abc", StringUtils.join("a", "b", "c")); +205 assertEquals("a", StringUtils.join(null, "", "a")); +206 assertEquals(null, StringUtils.join((Object[])null)); +207 } +208 +209 @Test +210 public void testJoin_Objectarray() { +211 // assertEquals(null, StringUtils.join(null)); // generates warning +212 assertEquals(null, StringUtils.join((Object[]) null)); // equivalent explicit cast +213 // test additional varargs calls +214 assertEquals("", StringUtils.join()); // empty array +215 assertEquals("", StringUtils.join((Object) null)); // => new Object[]{null} +216 +217 assertEquals("", StringUtils.join(EMPTY_ARRAY_LIST)); +218 assertEquals("", StringUtils.join(NULL_ARRAY_LIST)); +219 assertEquals("null", StringUtils.join(NULL_TO_STRING_LIST)); +220 assertEquals("abc", StringUtils.join(new String[] {"a", "b", "c"})); +221 assertEquals("a", StringUtils.join(new String[] {null, "a", ""})); +222 assertEquals("foo", StringUtils.join(MIXED_ARRAY_LIST)); +223 assertEquals("foo2", StringUtils.join(MIXED_TYPE_LIST)); +224 } +225 +226 @Test +227 public void testJoin_ArrayCharSeparator() { +228 assertEquals(null, StringUtils.join((Object[]) null, ',')); +229 assertEquals(TEXT_LIST_CHAR, StringUtils.join(ARRAY_LIST, SEPARATOR_CHAR)); +230 assertEquals("", StringUtils.join(EMPTY_ARRAY_LIST, SEPARATOR_CHAR)); +231 assertEquals(";;foo", StringUtils.join(MIXED_ARRAY_LIST, SEPARATOR_CHAR)); +232 assertEquals("foo;2", StringUtils.join(MIXED_TYPE_LIST, SEPARATOR_CHAR)); +233 +234 assertEquals("/", StringUtils.join(MIXED_ARRAY_LIST, '/', 0, MIXED_ARRAY_LIST.length-1)); +235 assertEquals("foo", StringUtils.join(MIXED_TYPE_LIST, '/', 0, 1)); +236 assertEquals("null", StringUtils.join(NULL_TO_STRING_LIST,'/', 0, 1)); +237 assertEquals("foo/2", StringUtils.join(MIXED_TYPE_LIST, '/', 0, 2)); +238 assertEquals("2", StringUtils.join(MIXED_TYPE_LIST, '/', 1, 2)); +239 assertEquals("", StringUtils.join(MIXED_TYPE_LIST, '/', 2, 1)); +240 } +241 +242 @Test +243 public void testJoin_ArrayOfChars() { +244 assertEquals(null, StringUtils.join((char[]) null, ',')); +245 assertEquals("1;2", StringUtils.join(CHAR_PRIM_LIST, SEPARATOR_CHAR)); +246 assertEquals("2", StringUtils.join(CHAR_PRIM_LIST, SEPARATOR_CHAR, 1, 2)); +247 } +248 +249 @Test +250 public void testJoin_ArrayOfBytes() { +251 assertEquals(null, StringUtils.join((byte[]) null, ',')); +252 assertEquals("1;2", StringUtils.join(BYTE_PRIM_LIST, SEPARATOR_CHAR)); +253 assertEquals("2", StringUtils.join(BYTE_PRIM_LIST, SEPARATOR_CHAR, 1, 2)); +254 } +255 +256 @Test +257 public void testJoin_ArrayOfInts() { +258 assertEquals(null, StringUtils.join((int[]) null, ',')); +259 assertEquals("1;2", StringUtils.join(INT_PRIM_LIST, SEPARATOR_CHAR)); +260 assertEquals("2", StringUtils.join(INT_PRIM_LIST, SEPARATOR_CHAR, 1, 2)); +261 } +262 +263 @Test +264 public void testJoin_ArrayOfLongs() { +265 assertEquals(null, StringUtils.join((long[]) null, ',')); +266 assertEquals("1;2", StringUtils.join(LONG_PRIM_LIST, SEPARATOR_CHAR)); +267 assertEquals("2", StringUtils.join(LONG_PRIM_LIST, SEPARATOR_CHAR, 1, 2)); +268 } +269 +270 @Test +271 public void testJoin_ArrayOfFloats() { +272 assertEquals(null, StringUtils.join((float[]) null, ',')); +273 assertEquals("1.0;2.0", StringUtils.join(FLOAT_PRIM_LIST, SEPARATOR_CHAR)); +274 assertEquals("2.0", StringUtils.join(FLOAT_PRIM_LIST, SEPARATOR_CHAR, 1, 2)); +275 } +276 +277 @Test +278 public void testJoin_ArrayOfDoubles() { +279 assertEquals(null, StringUtils.join((double[]) null, ',')); +280 assertEquals("1.0;2.0", StringUtils.join(DOUBLE_PRIM_LIST, SEPARATOR_CHAR)); +281 assertEquals("2.0", StringUtils.join(DOUBLE_PRIM_LIST, SEPARATOR_CHAR, 1, 2)); +282 } +283 +284 @Test +285 public void testJoin_ArrayOfShorts() { +286 assertEquals(null, StringUtils.join((short[]) null, ',')); +287 assertEquals("1;2", StringUtils.join(SHORT_PRIM_LIST, SEPARATOR_CHAR)); +288 assertEquals("2", StringUtils.join(SHORT_PRIM_LIST, SEPARATOR_CHAR, 1, 2)); +289 } +290 +291 @Test +292 public void testJoin_ArrayString() { +293 assertEquals(null, StringUtils.join((Object[]) null, null)); +294 assertEquals(TEXT_LIST_NOSEP, StringUtils.join(ARRAY_LIST, null)); +295 assertEquals(TEXT_LIST_NOSEP, StringUtils.join(ARRAY_LIST, "")); +296 +297 assertEquals("", StringUtils.join(NULL_ARRAY_LIST, null)); +298 +299 assertEquals("", StringUtils.join(EMPTY_ARRAY_LIST, null)); +300 assertEquals("", StringUtils.join(EMPTY_ARRAY_LIST, "")); +301 assertEquals("", StringUtils.join(EMPTY_ARRAY_LIST, SEPARATOR)); +302 +303 assertEquals(TEXT_LIST, StringUtils.join(ARRAY_LIST, SEPARATOR)); +304 assertEquals(",,foo", StringUtils.join(MIXED_ARRAY_LIST, SEPARATOR)); +305 assertEquals("foo,2", StringUtils.join(MIXED_TYPE_LIST, SEPARATOR)); +306 +307 assertEquals("/", StringUtils.join(MIXED_ARRAY_LIST, "/", 0, MIXED_ARRAY_LIST.length-1)); +308 assertEquals("", StringUtils.join(MIXED_ARRAY_LIST, "", 0, MIXED_ARRAY_LIST.length-1)); +309 assertEquals("foo", StringUtils.join(MIXED_TYPE_LIST, "/", 0, 1)); +310 assertEquals("foo/2", StringUtils.join(MIXED_TYPE_LIST, "/", 0, 2)); +311 assertEquals("2", StringUtils.join(MIXED_TYPE_LIST, "/", 1, 2)); +312 assertEquals("", StringUtils.join(MIXED_TYPE_LIST, "/", 2, 1)); +313 } +314 +315 @Test +316 public void testJoin_IteratorChar() { +317 assertEquals(null, StringUtils.join((Iterator<?>) null, ',')); +318 assertEquals(TEXT_LIST_CHAR, StringUtils.join(Arrays.asList(ARRAY_LIST).iterator(), SEPARATOR_CHAR)); +319 assertEquals("", StringUtils.join(Arrays.asList(NULL_ARRAY_LIST).iterator(), SEPARATOR_CHAR)); +320 assertEquals("", StringUtils.join(Arrays.asList(EMPTY_ARRAY_LIST).iterator(), SEPARATOR_CHAR)); +321 assertEquals("foo", StringUtils.join(Collections.singleton("foo").iterator(), 'x')); +322 } +323 +324 @Test +325 public void testJoin_IteratorString() { +326 assertEquals(null, StringUtils.join((Iterator<?>) null, null)); +327 assertEquals(TEXT_LIST_NOSEP, StringUtils.join(Arrays.asList(ARRAY_LIST).iterator(), null)); +328 assertEquals(TEXT_LIST_NOSEP, StringUtils.join(Arrays.asList(ARRAY_LIST).iterator(), "")); +329 assertEquals("foo", StringUtils.join(Collections.singleton("foo").iterator(), "x")); +330 assertEquals("foo", StringUtils.join(Collections.singleton("foo").iterator(), null)); +331 +332 assertEquals("", StringUtils.join(Arrays.asList(NULL_ARRAY_LIST).iterator(), null)); +333 +334 assertEquals("", StringUtils.join(Arrays.asList(EMPTY_ARRAY_LIST).iterator(), null)); +335 assertEquals("", StringUtils.join(Arrays.asList(EMPTY_ARRAY_LIST).iterator(), "")); +336 assertEquals("", StringUtils.join(Arrays.asList(EMPTY_ARRAY_LIST).iterator(), SEPARATOR)); +337 +338 assertEquals(TEXT_LIST, StringUtils.join(Arrays.asList(ARRAY_LIST).iterator(), SEPARATOR)); +339 } +340 +341 @Test +342 public void testJoin_IterableChar() { +343 assertEquals(null, StringUtils.join((Iterable<?>) null, ',')); +344 assertEquals(TEXT_LIST_CHAR, StringUtils.join(Arrays.asList(ARRAY_LIST), SEPARATOR_CHAR)); +345 assertEquals("", StringUtils.join(Arrays.asList(NULL_ARRAY_LIST), SEPARATOR_CHAR)); +346 assertEquals("", StringUtils.join(Arrays.asList(EMPTY_ARRAY_LIST), SEPARATOR_CHAR)); +347 assertEquals("foo", StringUtils.join(Collections.singleton("foo"), 'x')); +348 } +349 +350 @Test +351 public void testJoin_IterableString() { +352 assertEquals(null, StringUtils.join((Iterable<?>) null, null)); +353 assertEquals(TEXT_LIST_NOSEP, StringUtils.join(Arrays.asList(ARRAY_LIST), null)); +354 assertEquals(TEXT_LIST_NOSEP, StringUtils.join(Arrays.asList(ARRAY_LIST), "")); +355 assertEquals("foo", StringUtils.join(Collections.singleton("foo"), "x")); +356 assertEquals("foo", StringUtils.join(Collections.singleton("foo"), null)); +357 +358 assertEquals("", StringUtils.join(Arrays.asList(NULL_ARRAY_LIST), null)); +359 +360 assertEquals("", StringUtils.join(Arrays.asList(EMPTY_ARRAY_LIST), null)); +361 assertEquals("", StringUtils.join(Arrays.asList(EMPTY_ARRAY_LIST), "")); +362 assertEquals("", StringUtils.join(Arrays.asList(EMPTY_ARRAY_LIST), SEPARATOR)); 363 -364 @Test -365 public void testSplit_String() { -366 assertArrayEquals(null, StringUtils.split(null)); -367 assertEquals(0, StringUtils.split("").length); -368 -369 String str = "a b .c"; -370 String[] res = StringUtils.split(str); -371 assertEquals(3, res.length); -372 assertEquals("a", res[0]); -373 assertEquals("b", res[1]); -374 assertEquals(".c", res[2]); -375 -376 str = " a "; -377 res = StringUtils.split(str); -378 assertEquals(1, res.length); -379 assertEquals("a", res[0]); -380 -381 str = "a" + WHITESPACE + "b" + NON_WHITESPACE + "c"; -382 res = StringUtils.split(str); -383 assertEquals(2, res.length); -384 assertEquals("a", res[0]); -385 assertEquals("b" + NON_WHITESPACE + "c", res[1]); -386 } -387 -388 @Test -389 public void testSplit_StringChar() { -390 assertArrayEquals(null, StringUtils.split(null, '.')); -391 assertEquals(0, StringUtils.split("", '.').length); -392 -393 String str = "a.b.. c"; -394 String[] res = StringUtils.split(str, '.'); -395 assertEquals(3, res.length); -396 assertEquals("a", res[0]); -397 assertEquals("b", res[1]); -398 assertEquals(" c", res[2]); -399 -400 str = ".a."; -401 res = StringUtils.split(str, '.'); -402 assertEquals(1, res.length); -403 assertEquals("a", res[0]); -404 -405 str = "a b c"; -406 res = StringUtils.split(str,' '); -407 assertEquals(3, res.length); -408 assertEquals("a", res[0]); -409 assertEquals("b", res[1]); -410 assertEquals("c", res[2]); -411 } -412 -413 @Test -414 public void testSplit_StringString_StringStringInt() { -415 assertArrayEquals(null, StringUtils.split(null, ".")); -416 assertArrayEquals(null, StringUtils.split(null, ".", 3)); -417 -418 assertEquals(0, StringUtils.split("", ".").length); -419 assertEquals(0, StringUtils.split("", ".", 3).length); +364 assertEquals(TEXT_LIST, StringUtils.join(Arrays.asList(ARRAY_LIST), SEPARATOR)); +365 } +366 +367 @Test +368 public void testSplit_String() { +369 assertArrayEquals(null, StringUtils.split(null)); +370 assertEquals(0, StringUtils.split("").length); +371 +372 String str = "a b .c"; +373 String[] res = StringUtils.split(str); +374 assertEquals(3, res.length); +375 assertEquals("a", res[0]); +376 assertEquals("b", res[1]); +377 assertEquals(".c", res[2]); +378 +379 str = " a "; +380 res = StringUtils.split(str); +381 assertEquals(1, res.length); +382 assertEquals("a", res[0]); +383 +384 str = "a" + WHITESPACE + "b" + NON_WHITESPACE + "c"; +385 res = StringUtils.split(str); +386 assertEquals(2, res.length); +387 assertEquals("a", res[0]); +388 assertEquals("b" + NON_WHITESPACE + "c", res[1]); +389 } +390 +391 @Test +392 public void testSplit_StringChar() { +393 assertArrayEquals(null, StringUtils.split(null, '.')); +394 assertEquals(0, StringUtils.split("", '.').length); +395 +396 String str = "a.b.. c"; +397 String[] res = StringUtils.split(str, '.'); +398 assertEquals(3, res.length); +399 assertEquals("a", res[0]); +400 assertEquals("b", res[1]); +401 assertEquals(" c", res[2]); +402 +403 str = ".a."; +404 res = StringUtils.split(str, '.'); +405 assertEquals(1, res.length); +406 assertEquals("a", res[0]); +407 +408 str = "a b c"; +409 res = StringUtils.split(str,' '); +410 assertEquals(3, res.length); +411 assertEquals("a", res[0]); +412 assertEquals("b", res[1]); +413 assertEquals("c", res[2]); +414 } +415 +416 @Test +417 public void testSplit_StringString_StringStringInt() { +418 assertArrayEquals(null, StringUtils.split(null, ".")); +419 assertArrayEquals(null, StringUtils.split(null, ".", 3)); 420 -421 innerTestSplit('.', ".", ' '); -422 innerTestSplit('.', ".", ','); -423 innerTestSplit('.', ".,", 'x'); -424 for (int i = 0; i < WHITESPACE.length(); i++) { -425 for (int j = 0; j < NON_WHITESPACE.length(); j++) { -426 innerTestSplit(WHITESPACE.charAt(i), null, NON_WHITESPACE.charAt(j)); -427 innerTestSplit(WHITESPACE.charAt(i), String.valueOf(WHITESPACE.charAt(i)), NON_WHITESPACE.charAt(j)); -428 } -429 } -430 -431 String[] results; -432 final String[] expectedResults = {"ab", "de fg"}; -433 results = StringUtils.split("ab de fg", null, 2); -434 assertEquals(expectedResults.length, results.length); -435 for (int i = 0; i < expectedResults.length; i++) { -436 assertEquals(expectedResults[i], results[i]); -437 } -438 -439 final String[] expectedResults2 = {"ab", "cd:ef"}; -440 results = StringUtils.split("ab:cd:ef",":", 2); -441 assertEquals(expectedResults2.length, results.length); -442 for (int i = 0; i < expectedResults2.length; i++) { -443 assertEquals(expectedResults2[i], results[i]); -444 } -445 } -446 -447 private void innerTestSplit(final char separator, final String sepStr, final char noMatch) { -448 final String msg = "Failed on separator hex(" + Integer.toHexString(separator) + -449 "), noMatch hex(" + Integer.toHexString(noMatch) + "), sepStr(" + sepStr + ")"; -450 -451 final String str = "a" + separator + "b" + separator + separator + noMatch + "c"; -452 String[] res; -453 // (str, sepStr) -454 res = StringUtils.split(str, sepStr); -455 assertEquals(msg, 3, res.length); -456 assertEquals(msg, "a", res[0]); -457 assertEquals(msg, "b", res[1]); -458 assertEquals(msg, noMatch + "c", res[2]); -459 -460 final String str2 = separator + "a" + separator; -461 res = StringUtils.split(str2, sepStr); -462 assertEquals(msg, 1, res.length); -463 assertEquals(msg, "a", res[0]); -464 -465 res = StringUtils.split(str, sepStr, -1); -466 assertEquals(msg, 3, res.length); -467 assertEquals(msg, "a", res[0]); -468 assertEquals(msg, "b", res[1]); -469 assertEquals(msg, noMatch + "c", res[2]); -470 -471 res = StringUtils.split(str, sepStr, 0); -472 assertEquals(msg, 3, res.length); -473 assertEquals(msg, "a", res[0]); -474 assertEquals(msg, "b", res[1]); -475 assertEquals(msg, noMatch + "c", res[2]); -476 -477 res = StringUtils.split(str, sepStr, 1); -478 assertEquals(msg, 1, res.length); -479 assertEquals(msg, str, res[0]); -480 -481 res = StringUtils.split(str, sepStr, 2); -482 assertEquals(msg, 2, res.length); -483 assertEquals(msg, "a", res[0]); -484 assertEquals(msg, str.substring(2), res[1]); -485 } -486 -487 @Test -488 public void testSplitByWholeString_StringStringBoolean() { -489 assertArrayEquals( null, StringUtils.splitByWholeSeparator( null, "." ) ) ; -490 -491 assertEquals( 0, StringUtils.splitByWholeSeparator( "", "." ).length ) ; -492 -493 final String stringToSplitOnNulls = "ab de fg" ; -494 final String[] splitOnNullExpectedResults = { "ab", "de", "fg" } ; +421 assertEquals(0, StringUtils.split("", ".").length); +422 assertEquals(0, StringUtils.split("", ".", 3).length); +423 +424 innerTestSplit('.', ".", ' '); +425 innerTestSplit('.', ".", ','); +426 innerTestSplit('.', ".,", 'x'); +427 for (int i = 0; i < WHITESPACE.length(); i++) { +428 for (int j = 0; j < NON_WHITESPACE.length(); j++) { +429 innerTestSplit(WHITESPACE.charAt(i), null, NON_WHITESPACE.charAt(j)); +430 innerTestSplit(WHITESPACE.charAt(i), String.valueOf(WHITESPACE.charAt(i)), NON_WHITESPACE.charAt(j)); +431 } +432 } +433 +434 String[] results; +435 final String[] expectedResults = {"ab", "de fg"}; +436 results = StringUtils.split("ab de fg", null, 2); +437 assertEquals(expectedResults.length, results.length); +438 for (int i = 0; i < expectedResults.length; i++) { +439 assertEquals(expectedResults[i], results[i]); +440 } +441 +442 final String[] expectedResults2 = {"ab", "cd:ef"}; +443 results = StringUtils.split("ab:cd:ef",":", 2); +444 assertEquals(expectedResults2.length, results.length); +445 for (int i = 0; i < expectedResults2.length; i++) { +446 assertEquals(expectedResults2[i], results[i]); +447 } +448 } +449 +450 private void innerTestSplit(final char separator, final String sepStr, final char noMatch) { +451 final String msg = "Failed on separator hex(" + Integer.toHexString(separator) + +452 "), noMatch hex(" + Integer.toHexString(noMatch) + "), sepStr(" + sepStr + ")"; +453 +454 final String str = "a" + separator + "b" + separator + separator + noMatch + "c"; +455 String[] res; +456 // (str, sepStr) +457 res = StringUtils.split(str, sepStr); [... 3688 lines stripped ...]