Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 74330 invoked from network); 22 Jun 2010 11:06:25 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Jun 2010 11:06:25 -0000 Received: (qmail 46432 invoked by uid 500); 22 Jun 2010 11:06:25 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 45903 invoked by uid 500); 22 Jun 2010 11:06:22 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 45895 invoked by uid 99); 22 Jun 2010 11:06:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jun 2010 11:06:21 +0000 X-ASF-Spam-Status: No, hits=-0.3 required=10.0 tests=AWL,FREEMAIL_FROM,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sebbaz@gmail.com designates 209.85.161.43 as permitted sender) Received: from [209.85.161.43] (HELO mail-fx0-f43.google.com) (209.85.161.43) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jun 2010 11:06:14 +0000 Received: by fxm8 with SMTP id 8so663530fxm.30 for ; Tue, 22 Jun 2010 04:05:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=+wZWwY+yqJhSinAz8U53l2mwcAFjzkgG12lLlN1de94=; b=w3Fnc7O2lH+VS7wHdD+LZ/EVvWf0MjKaJeRvQ/ac84vVEDlZN8bfROIq/r53z4Ysvb +YeDbWpEDo1qRLNJvIdOOpryBJ+ardj06ktNiuReNBKLZEu5muQqooi0ELTCe77nsgrv isgc7MlwMUMYTl0QIJPrugjJ8CfSiGKDiZA6U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Rmco7DKRkvd+gmSOb7ePj22ZhxvcOU3NkMuPdlwBJSYY2GkP6xJ8thlmyPUjgc8LVe /2h3YfZb59pCC9PA6JGxQctva6tfco+PPg79B3b8lTHNUG391F/NWqvco1+p9Zh2t1G2 BaZTXfkP5ZizY9GTTKMu49SeQ4aOy7mv81utU= MIME-Version: 1.0 Received: by 10.239.189.134 with SMTP id t6mr439125hbh.73.1277204753249; Tue, 22 Jun 2010 04:05:53 -0700 (PDT) Received: by 10.239.187.206 with HTTP; Tue, 22 Jun 2010 04:05:53 -0700 (PDT) In-Reply-To: <20100622054448.0C04223889E0@eris.apache.org> References: <20100622054448.0C04223889E0@eris.apache.org> Date: Tue, 22 Jun 2010 12:05:53 +0100 Message-ID: Subject: Re: svn commit: r956775 - in /commons/proper/lang/trunk: NOTICE.txt src/main/java/org/apache/commons/lang3/StringUtils.java src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java From: sebb To: dev@commons.apache.org Content-Type: text/plain; charset=ISO-8859-1 On 22/06/2010, bayard@apache.org wrote: > Author: bayard > Date: Tue Jun 22 05:44:47 2010 > New Revision: 956775 > > URL: http://svn.apache.org/viewvc?rev=956775&view=rev > Log: > Adding containsWhitespace method per LANG-625. Code comes from the Spring framework, so I've added such to the NOTICE file. License is Apache License 2.0. Unit test is original. > > Modified: > commons/proper/lang/trunk/NOTICE.txt > commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java > commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java > > Modified: commons/proper/lang/trunk/NOTICE.txt > URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/NOTICE.txt?rev=956775&r1=956774&r2=956775&view=diff > ============================================================================== > --- commons/proper/lang/trunk/NOTICE.txt (original) > +++ commons/proper/lang/trunk/NOTICE.txt Tue Jun 22 05:44:47 2010 > @@ -3,3 +3,5 @@ Copyright 2001-2010 The Apache Software > > This product includes software developed by > The Apache Software Foundation (http://www.apache.org/). > + > +This product includes software from the Spring Framework. That makes it sound like there are large chunks of code, instead of a single method. Might be an idea to note the method name, i.e. put: This product includes software from the Spring Framework, see: StringUtils.containsWhitespace() > > 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=956775&r1=956774&r2=956775&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 Tue Jun 22 05:44:47 2010 > @@ -1347,6 +1347,28 @@ public class StringUtils { > return false; > } > > + /** > + * Check whether the given String contains any whitespace characters. > + * @param str the String to check (may be null) > + * @return true if the String is not empty and > + * contains at least 1 whitespace character > + * @see java.lang.Character#isWhitespace > + * @since 3.0 > + */ > + // From org.springframework.util.StringUtils, under Apache License 2.0 > + public static boolean containsWhitespace(String str) { > + if (isEmpty(str)) { > + return false; > + } > + int strLen = str.length(); > + for (int i = 0; i < strLen; i++) { > + if (Character.isWhitespace(str.charAt(i))) { > + return true; > + } > + } > + return false; > + } > + > // IndexOfAny chars > //----------------------------------------------------------------------- > /** > > Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java > URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java?rev=956775&r1=956774&r2=956775&view=diff > ============================================================================== > --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java (original) > +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java Tue Jun 22 05:44:47 2010 > @@ -431,6 +431,16 @@ public class StringUtilsEqualsIndexOfTes > assertEquals(true, StringUtils.containsOnly(str3, chars3)); > } > > + public void testContainsWhitespace() { > + assertFalse( StringUtils.containsWhitespace("") ); > + assertTrue( StringUtils.containsWhitespace(" ") ); > + assertFalse( StringUtils.containsWhitespace("a") ); > + assertTrue( StringUtils.containsWhitespace("a ") ); > + assertTrue( StringUtils.containsWhitespace(" a") ); > + assertTrue( StringUtils.containsWhitespace("a\t") ); > + assertTrue( StringUtils.containsWhitespace("\n") ); > + } > + > public void testEquals() { > assertEquals(true, StringUtils.equals(null, null)); > assertEquals(true, StringUtils.equals(FOO, FOO)); > > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org