From a9b61fc42746e38e8bd22c419ffdb803e2a41511 Mon Sep 17 00:00:00 2001 From: "Gary D. Gregory" Date: Sun, 14 Mar 2010 17:44:23 +0000 Subject: [PATCH] Back out a CSU experiment. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@922911 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/lang3/CharSequenceUtils.java | 26 ------------------- .../org/apache/commons/lang3/StringUtils.java | 2 +- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java b/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java index 5bda1fb9a..652ea94b6 100644 --- a/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java +++ b/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java @@ -37,32 +37,6 @@ public class CharSequenceUtils { return cs == null ? 0 : cs.length(); } - /** - *

- * Reverses a CharSequence as per {@link StringBuilder#reverse()}. - *

- * - *

- * A null CharSequence returns null. - *

- * - *
-	 * CharSequenceUtils.reverse(null) = null
-	 * CharSequenceUtils.reverse("").toString() = ""
-	 * CharSequenceUtils.reverse("bat").toString() = "tab"
-	 * 
- * - * @param str - * the String to reverse, may be null - * @return the reversed String, null if null String input - */ - public static CharSequence reverse(CharSequence str) { - if (str == null) { - return null; - } - return new StringBuilder(str).reverse(); - } - /** * Returns a new CharSequence that is a subsequence of this * sequence starting with the char value at the specified diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java b/src/main/java/org/apache/commons/lang3/StringUtils.java index bb4f8ba51..f450c4af6 100644 --- a/src/main/java/org/apache/commons/lang3/StringUtils.java +++ b/src/main/java/org/apache/commons/lang3/StringUtils.java @@ -5414,7 +5414,7 @@ public class StringUtils { if (str == null) { return null; } - return CharSequenceUtils.reverse(str).toString(); + return new StringBuilder(str).reverse().toString(); } /**