commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1407536 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
Date Fri, 09 Nov 2012 16:45:38 GMT
Author: mbenson
Date: Fri Nov  9 16:45:37 2012
New Revision: 1407536

URL: http://svn.apache.org/viewvc?rev=1407536&view=rev
Log:
restrict whitespace pattern to ignore 'blocks' of whitespace consisting of only a single space

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=1407536&r1=1407535&r2=1407536&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
Nov  9 16:45:37 2012
@@ -151,7 +151,7 @@ public class StringUtils {
     /**
      * A regex pattern for recognizing blocks of whitespace characters.
      */
-    private static final Pattern WHITESPACE_PATTERN = Pattern.compile("\\s+");
+    private static final Pattern WHITESPACE_PATTERN = Pattern.compile("(?: \\s|[\\s&&[^
]])\\s*");
 
     /**
      * <p>{@code StringUtils} instances should NOT be constructed in



Mime
View raw message