commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1407148 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
Date Thu, 08 Nov 2012 16:08:24 GMT
Author: ggregory
Date: Thu Nov  8 16:08:23 2012
New Revision: 1407148

URL: http://svn.apache.org/viewvc?rev=1407148&view=rev
Log:
[LANG-701] StringUtils join with var args. Add and use SPACE string constant for " ".

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=1407148&r1=1407147&r2=1407148&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 Thu
Nov  8 16:08:23 2012
@@ -125,6 +125,13 @@ public class StringUtils {
     // (not sure who tested this)
 
     /**
+     * A String for a space character.
+     * 
+     * @since 3.2
+     */
+    public static final String SPACE = " ";
+
+    /**
      * The empty String {@code ""}.
      * @since 2.0
      */
@@ -4581,7 +4588,7 @@ public class StringUtils {
             return null;
         }
         if (isEmpty(padStr)) {
-            padStr = " ";
+            padStr = SPACE;
         }
         int padLen = padStr.length();
         int strLen = str.length();
@@ -4693,7 +4700,7 @@ public class StringUtils {
             return null;
         }
         if (isEmpty(padStr)) {
-            padStr = " ";
+            padStr = SPACE;
         }
         int padLen = padStr.length();
         int strLen = str.length();
@@ -4832,7 +4839,7 @@ public class StringUtils {
             return str;
         }
         if (isEmpty(padStr)) {
-            padStr = " ";
+            padStr = SPACE;
         }
         int strLen = str.length();
         int pads = size - strLen;
@@ -6472,7 +6479,7 @@ public class StringUtils {
         if (str == null) {
             return null;
         }
-        return WHITESPACE_PATTERN.matcher(trim(str)).replaceAll(" ");
+        return WHITESPACE_PATTERN.matcher(trim(str)).replaceAll(SPACE);
     }
 
     /**



Mime
View raw message