You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ba...@apache.org on 2015/07/19 10:26:12 UTC
[lang] Switched capitalize back to using toTitleCase. Added a test
for this using the 'Lj' letter. LANG-1142
Repository: commons-lang
Updated Branches:
refs/heads/master cc1aed9bd -> 421db380d
Switched capitalize back to using toTitleCase. Added a test for this using the 'Lj' letter. LANG-1142
Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/421db380
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/421db380
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/421db380
Branch: refs/heads/master
Commit: 421db380d060e9f037a8ecbc446c414efaa6923f
Parents: cc1aed9
Author: Henri Yandell <ba...@apache.org>
Authored: Sun Jul 19 01:25:10 2015 -0700
Committer: Henri Yandell <ba...@apache.org>
Committed: Sun Jul 19 01:25:45 2015 -0700
----------------------------------------------------------------------
src/main/java/org/apache/commons/lang3/StringUtils.java | 2 +-
src/test/java/org/apache/commons/lang3/StringUtilsTest.java | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-lang/blob/421db380/src/main/java/org/apache/commons/lang3/StringUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java b/src/main/java/org/apache/commons/lang3/StringUtils.java
index 968093a..a0f83a1 100644
--- a/src/main/java/org/apache/commons/lang3/StringUtils.java
+++ b/src/main/java/org/apache/commons/lang3/StringUtils.java
@@ -5765,7 +5765,7 @@ public class StringUtils {
}
final char firstChar = str.charAt(0);
- final char newChar = Character.toUpperCase(firstChar);
+ final char newChar = Character.toTitleCase(firstChar);
if (firstChar == newChar) {
// already capitalized
return str;
http://git-wip-us.apache.org/repos/asf/commons-lang/blob/421db380/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
index 49c9572..5cc665a 100644
--- a/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
@@ -250,6 +250,9 @@ public class StringUtilsTest {
assertEquals("capitalize(string) failed",
FOO_CAP, StringUtils.capitalize(FOO_UNCAP));
+ assertEquals("capitalize(String) is not using TitleCase",
+ "\u01C8", StringUtils.capitalize("\u01C9"));
+
// Javadoc examples
assertNull(StringUtils.capitalize(null));
assertEquals("", StringUtils.capitalize(""));