commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r1161997 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
Date Fri, 26 Aug 2011 05:19:00 GMT
Author: bayard
Date: Fri Aug 26 05:19:00 2011
New Revision: 1161997

URL: http://svn.apache.org/viewvc?rev=1161997&view=rev
Log:
Deprecating chomp(String, String) per Verneri Ã…berg's report in LANG-748

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java?rev=1161997&r1=1161996&r2=1161997&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java Fri
Aug 26 05:19:00 2011
@@ -4381,15 +4381,11 @@ public class StringUtils {
      * @param str  the String to chomp from, may be null
      * @param separator  separator String, may be null
      * @return String without trailing separator, {@code null} if null String input
+     * @deprecated This feature will be removed in Lang 4.0
      */
+    @Deprecated
     public static String chomp(String str, String separator) {
-        if (isEmpty(str) || separator == null) {
-            return str;
-        }
-        if (str.endsWith(separator)) {
-            return str.substring(0, str.length() - separator.length());
-        }
-        return str;
+        return removeEnd(str,separator);
     }
 
     // Chopping



Mime
View raw message