Return-Path: Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 35167 invoked by uid 500); 14 Aug 2003 00:04:05 -0000 Received: (qmail 35145 invoked from network); 14 Aug 2003 00:04:05 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 14 Aug 2003 00:04:05 -0000 Received: (qmail 90881 invoked by uid 1360); 14 Aug 2003 00:04:20 -0000 Date: 14 Aug 2003 00:04:20 -0000 Message-ID: <20030814000420.90880.qmail@minotaur.apache.org> From: bayard@apache.org To: jakarta-commons-cvs@apache.org Subject: cvs commit: jakarta-commons/lang/src/test/org/apache/commons/lang StringUtilsTest.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N bayard 2003/08/13 17:04:20 Modified: lang/src/java/org/apache/commons/lang StringUtils.java lang/src/test/org/apache/commons/lang StringUtilsTest.java Log: Deprecated the 'capitalise' spelling and introduced the 'capitalize' spelling. Despite the UK [or international] English base of many of the developers on Lang, it was felt that it would be better to match Jakarta as a whole. Also none of us cared enough to make it an issue. Revision Changes Path 1.94 +60 -32 jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java Index: StringUtils.java =================================================================== RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java,v retrieving revision 1.93 retrieving revision 1.94 diff -u -r1.93 -r1.94 --- StringUtils.java 13 Aug 2003 23:30:58 -0000 1.93 +++ StringUtils.java 14 Aug 2003 00:04:20 -0000 1.94 @@ -84,7 +84,7 @@ * - removes the last part of a String *
  • LeftPad/RightPad/Center/Repeat * - pads a String - *
  • UpperCase/LowerCase/SwapCase/Capitalise/Uncapitalise + *
  • UpperCase/LowerCase/SwapCase/Capitalize/Uncapitalize * - change the case of a String *
  • NestedString * - returns a substring nested within other Strings @@ -3410,22 +3410,22 @@ } /** - *

    Capitalises a String changing the first letter to title case as + *

    Capitalizes a String changing the first letter to title case as * per {@link Character#toTitleCase(char)}. No other letters are changed.

    * *

    A null input String returns null.

    * *
      -     * StringUtils.capitalise(null)  = null
      -     * StringUtils.capitalise("")    = ""
      -     * StringUtils.capitalise("cat") = "Cat"
      -     * StringUtils.capitalise("cAt") = "CAt"
      +     * StringUtils.capitalize(null)  = null
      +     * StringUtils.capitalize("")    = ""
      +     * StringUtils.capitalize("cat") = "Cat"
      +     * StringUtils.capitalize("cAt") = "CAt"
            * 
    * - * @param str the String to capitalise, may be null - * @return the capitalised String, null if null String input + * @param str the String to capitalize, may be null + * @return the capitalized String, null if null String input */ - public static String capitalise(String str) { + public static String capitalize(String str) { int strLen; if (str == null || (strLen = str.length()) == 0) { return str; @@ -3437,22 +3437,29 @@ } /** - *

    Uncapitalises a String changing the first letter to title case as + * @deprecated Use the standardly named {@link #capitalize(String)}. + */ + public static String capitalise(String str) { + return capitalize(str); + } + + /** + *

    Uncapitalizes a String changing the first letter to title case as * per {@link Character#toLowerCase(char)}. No other letters are changed.

    * *

    A null input String returns null.

    * *
      -     * StringUtils.uncapitalise(null)  = null
      -     * StringUtils.uncapitalise("")    = ""
      -     * StringUtils.uncapitalise("Cat") = "cat"
      -     * StringUtils.uncapitalise("CAT") = "cAT"
      +     * StringUtils.uncapitalize(null)  = null
      +     * StringUtils.uncapitalize("")    = ""
      +     * StringUtils.uncapitalize("Cat") = "cat"
      +     * StringUtils.uncapitalize("CAT") = "cAT"
            * 
    * - * @param str the String to uncapitalise, may be null - * @return the uncapitalised String, null if null String input + * @param str the String to uncapitalize, may be null + * @return the uncapitalized String, null if null String input */ - public static String uncapitalise(String str) { + public static String uncapitalize(String str) { int strLen; if (str == null || (strLen = str.length()) == 0) { return str; @@ -3464,6 +3471,13 @@ } /** + * @deprecated Use the standardly named {@link #uncapitalize(String)}. + */ + public static String uncapitalise(String str) { + return uncapitalize(str); + } + + /** *

    Swaps the case of a String using a word based algorithm.

    * *