From 91a22bc49472c0546a3aa71ff0351edaa497cb95 Mon Sep 17 00:00:00 2001 From: Stephen Colebourne Date: Sun, 20 Jul 2003 14:47:29 +0000 Subject: [PATCH] Add summary javadoc section to StringUtils class Rename reverseDelimitedString to reverseDelimited git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137472 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/commons/lang/StringUtils.java | 62 ++++++++++++++++--- .../apache/commons/lang/StringUtilsTest.java | 14 ++--- 2 files changed, 61 insertions(+), 15 deletions(-) diff --git a/src/java/org/apache/commons/lang/StringUtils.java b/src/java/org/apache/commons/lang/StringUtils.java index 4d1c4dfc6..2ab52c096 100644 --- a/src/java/org/apache/commons/lang/StringUtils.java +++ b/src/java/org/apache/commons/lang/StringUtils.java @@ -60,6 +60,51 @@ import java.util.List; /** *

Common String manipulation routines that are * null safe.

+ * + * * *

The StringUtils class defines certain words related to * String handling.

@@ -67,8 +112,9 @@ import java.util.List; * * *

StringUtils handles null input Strings quietly. @@ -96,7 +142,7 @@ import java.util.List; * @author Arun Mammen Thomas * @author Gary Gregory * @since 1.0 - * @version $Id: StringUtils.java,v 1.71 2003/07/20 10:29:22 scolebourne Exp $ + * @version $Id: StringUtils.java,v 1.72 2003/07/20 14:47:29 scolebourne Exp $ */ public class StringUtils { // Performance testing notes (JDK 1.4, Jul03, scolebourne) @@ -3335,17 +3381,17 @@ public class StringUtils { * is '.').

* *
-     * StringUtils.reverseDelimitedString(null, '.')    = null
-     * StringUtils.reverseDelimitedString("", '.')      = ""
-     * StringUtils.reverseDelimitedString("a.b.c", 'x') = "a.b.c"
-     * StringUtils.reverseDelimitedString("a.b.c", ".") = "c.b.a"
+     * StringUtils.reverseDelimited(null, '.')    = null
+     * StringUtils.reverseDelimited("", '.')      = ""
+     * StringUtils.reverseDelimited("a.b.c", 'x') = "a.b.c"
+     * StringUtils.reverseDelimited("a.b.c", ".") = "c.b.a"
      * 
* * @param str the String to reverse, may be null * @param separatorChar the separator character to use * @return the reversed String, null if null String input */ - public static String reverseDelimitedString(String str, char separatorChar) { + public static String reverseDelimited(String str, char separatorChar) { if (str == null) { return null; } @@ -3373,7 +3419,7 @@ public class StringUtils { * @param str the String to reverse, may be null * @param separatorChars the separator characters to use, null treated as whitespace * @return the reversed String, null if null String input - * @deprecated Use {@link #reverseDelimitedString(String, char)} instead. + * @deprecated Use {@link #reverseDelimited(String, char)} instead. * This method is broken as the join doesn't know which char to use. * Method will be removed in Commons Lang 3.0. * diff --git a/src/test/org/apache/commons/lang/StringUtilsTest.java b/src/test/org/apache/commons/lang/StringUtilsTest.java index 8e7026240..152e2f33a 100644 --- a/src/test/org/apache/commons/lang/StringUtilsTest.java +++ b/src/test/org/apache/commons/lang/StringUtilsTest.java @@ -72,7 +72,7 @@ import junit.textui.TestRunner; * @author Henning P. Schmiedehausen - * @version $Id: StringUtilsTest.java,v 1.32 2003/07/20 10:29:21 scolebourne Exp $ + * @version $Id: StringUtilsTest.java,v 1.33 2003/07/20 14:47:29 scolebourne Exp $ */ public class StringUtilsTest extends TestCase { @@ -704,12 +704,12 @@ public class StringUtilsTest extends TestCase { assertEquals("sdrawkcab", StringUtils.reverse("backwards") ); } - public void testReverseDelimitedString_StringChar() { - assertEquals(null, StringUtils.reverseDelimitedString(null, '.') ); - assertEquals("", StringUtils.reverseDelimitedString("", '.') ); - assertEquals("c.b.a", StringUtils.reverseDelimitedString("a.b.c", '.') ); - assertEquals("a b c", StringUtils.reverseDelimitedString("a b c", '.') ); - assertEquals("", StringUtils.reverseDelimitedString("", '.') ); + public void testReverseDelimited_StringChar() { + assertEquals(null, StringUtils.reverseDelimited(null, '.') ); + assertEquals("", StringUtils.reverseDelimited("", '.') ); + assertEquals("c.b.a", StringUtils.reverseDelimited("a.b.c", '.') ); + assertEquals("a b c", StringUtils.reverseDelimited("a b c", '.') ); + assertEquals("", StringUtils.reverseDelimited("", '.') ); } public void testReverseDelimitedString_StringString() {