Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F31DDD902 for ; Fri, 9 Nov 2012 16:51:03 +0000 (UTC) Received: (qmail 79814 invoked by uid 500); 9 Nov 2012 16:51:03 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 79751 invoked by uid 500); 9 Nov 2012 16:51:03 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 79744 invoked by uid 99); 9 Nov 2012 16:51:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Nov 2012 16:51:03 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Nov 2012 16:51:01 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 483FE2388980 for ; Fri, 9 Nov 2012 16:50:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1407537 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java Date: Fri, 09 Nov 2012 16:50:40 -0000 To: commits@commons.apache.org From: mbenson@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121109165040.483FE2388980@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mbenson Date: Fri Nov 9 16:50:39 2012 New Revision: 1407537 URL: http://svn.apache.org/viewvc?rev=1407537&view=rev Log: explain whitespace pattern 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=1407537&r1=1407536&r2=1407537&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:50:39 2012 @@ -150,6 +150,11 @@ public class StringUtils { /** * A regex pattern for recognizing blocks of whitespace characters. + * The apparent convolutedness of the pattern serves the purpose of + * ignoring "blocks" consisting of only a single space: the pattern + * is used only to normalize whitespace, condensing "blocks" down to a + * single space, thus matching the same would likely cause a great + * many noop replacements. */ private static final Pattern WHITESPACE_PATTERN = Pattern.compile("(?: \\s|[\\s&&[^ ]])\\s*");