You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ch...@apache.org on 2017/07/06 19:21:05 UTC
[1/4] [text] TEXT-88: Fixed issue with empty delimiters array with
capitalizeFully
Repository: commons-text
Updated Branches:
refs/heads/master 5e479dcd7 -> 9e48de8c8
TEXT-88: Fixed issue with empty delimiters array with capitalizeFully
Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/3f5dfd4b
Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/3f5dfd4b
Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/3f5dfd4b
Branch: refs/heads/master
Commit: 3f5dfd4b1cc24fa31446a9ea5821cf267375e552
Parents: c71a5cd
Author: Amey Jadiye <am...@gmail.com>
Authored: Mon Jun 12 23:26:46 2017 +0530
Committer: Amey Jadiye <am...@gmail.com>
Committed: Mon Jul 3 01:08:51 2017 +0530
----------------------------------------------------------------------
src/main/java/org/apache/commons/text/WordUtils.java | 9 +++------
src/test/java/org/apache/commons/text/WordUtilsTest.java | 10 ++++++++++
2 files changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-text/blob/3f5dfd4b/src/main/java/org/apache/commons/text/WordUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/WordUtils.java b/src/main/java/org/apache/commons/text/WordUtils.java
index 7d90730..0ffff07 100644
--- a/src/main/java/org/apache/commons/text/WordUtils.java
+++ b/src/main/java/org/apache/commons/text/WordUtils.java
@@ -411,8 +411,7 @@ public class WordUtils {
* @see #capitalizeFully(String)
*/
public static String capitalize(final String str, final char... delimiters) {
- final int delimLen = delimiters == null ? -1 : delimiters.length;
- if (StringUtils.isEmpty(str) || delimLen == 0) {
+ if (StringUtils.isEmpty(str)) {
return str;
}
int strLen = str.length();
@@ -490,8 +489,7 @@ public class WordUtils {
* @return capitalized String, <code>null</code> if null String input
*/
public static String capitalizeFully(String str, final char... delimiters) {
- final int delimLen = delimiters == null ? -1 : delimiters.length;
- if (StringUtils.isEmpty(str) || delimLen == 0) {
+ if (StringUtils.isEmpty(str)) {
return str;
}
str = str.toLowerCase();
@@ -545,8 +543,7 @@ public class WordUtils {
* @see #capitalize(String)
*/
public static String uncapitalize(final String str, final char... delimiters) {
- final int delimLen = delimiters == null ? -1 : delimiters.length;
- if (StringUtils.isEmpty(str) || delimLen == 0) {
+ if (StringUtils.isEmpty(str)) {
return str;
}
int strLen = str.length();
http://git-wip-us.apache.org/repos/asf/commons-text/blob/3f5dfd4b/src/test/java/org/apache/commons/text/WordUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/text/WordUtilsTest.java b/src/test/java/org/apache/commons/text/WordUtilsTest.java
index 425d6d4..6904790 100644
--- a/src/test/java/org/apache/commons/text/WordUtilsTest.java
+++ b/src/test/java/org/apache/commons/text/WordUtilsTest.java
@@ -229,6 +229,16 @@ public class WordUtilsTest {
}
@Test
+ public void testCapitalizeFully_Text88() {
+ assertEquals("I am fine now",WordUtils.capitalizeFully("i am fine now", new char[]{}));
+ }
+
+ @Test
+ public void testUnCapitalize_Text88() {
+ assertEquals("i am fine now",WordUtils.uncapitalize("I am fine now", new char[]{}));
+ }
+
+ @Test
public void testCapitalizeFullyWithDelimiters_String() {
assertEquals(null, WordUtils.capitalizeFully(null, null));
assertEquals("", WordUtils.capitalizeFully("", new char[0]));
[3/4] [text] Merge branch 'TEXT-88' of
https://github.com/ameyjadiye/commons-text
Posted by ch...@apache.org.
Merge branch 'TEXT-88' of https://github.com/ameyjadiye/commons-text
Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/ecaaf904
Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/ecaaf904
Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/ecaaf904
Branch: refs/heads/master
Commit: ecaaf9040561fbc410ad0375050af07bf20ca7fe
Parents: 5e479dc 6323af5
Author: Rob Tompkins <ch...@gmail.com>
Authored: Thu Jul 6 15:13:17 2017 -0400
Committer: Rob Tompkins <ch...@gmail.com>
Committed: Thu Jul 6 15:13:17 2017 -0400
----------------------------------------------------------------------
src/main/java/org/apache/commons/text/WordUtils.java | 11 +++++------
src/test/java/org/apache/commons/text/WordUtilsTest.java | 10 ++++++++++
2 files changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-text/blob/ecaaf904/src/test/java/org/apache/commons/text/WordUtilsTest.java
----------------------------------------------------------------------
[4/4] [text] TEXT-88: Thanks Amey.
Posted by ch...@apache.org.
TEXT-88: Thanks Amey.
Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/9e48de8c
Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/9e48de8c
Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/9e48de8c
Branch: refs/heads/master
Commit: 9e48de8c8ab5b23cf05fddc911ea5b55d6e29eff
Parents: ecaaf90
Author: Rob Tompkins <ch...@gmail.com>
Authored: Thu Jul 6 15:20:50 2017 -0400
Committer: Rob Tompkins <ch...@gmail.com>
Committed: Thu Jul 6 15:20:50 2017 -0400
----------------------------------------------------------------------
src/changes/changes.xml | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-text/blob/9e48de8c/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 41e9430..b1f71dc 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -46,8 +46,9 @@ The <action> type attribute can be add,update,fix,remove.
<body>
<release version="1.2" date="tbd" description="tbd">
- <action issue="TEXT-93" type="update" dev="chtompki" due-to="Amey Jadiye">Update RandomStringGenerator to accept a list of valid characters</action>
- <action issue="TEXT-90" type="add" dev="pschumacher">Add CharacterPredicates for ASCII letters (uppercase/lowercase) and arabic numerals</action>
+ <action issue="TEXT-88" type="update" dev="chtompki" due-to="Amey Jadiye">WordUtils should treat an empty delimiter array as no delimiters</action>
+ <action issue="TEXT-93" type="update" dev="chtompki" due-to="Amey Jadiye">Update RandomStringGenerator to accept a list of valid characters</action>
+ <action issue="TEXT-90" type="add" dev="pschumacher">Add CharacterPredicates for ASCII letters (uppercase/lowercase) and arabic numerals</action>
<action issue="TEXT-85" type="add" dev="chtompki" due-to="Arun Vinud S S">Added CaseUtils class with camel case conversion support</action>
<action issue="TEXT-91" type="add" dev="pschumacher">RandomStringGenerator should be able to generate a String with a random length</action>
<action issue="TEXT-92" type="update" dev="pschumacher">Update commons-lang dependency to version 3.6</action>
[2/4] [text] added javadoc for .capitalize() and .uncapitalize()
Posted by ch...@apache.org.
added javadoc for .capitalize() and .uncapitalize()
Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/6323af50
Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/6323af50
Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/6323af50
Branch: refs/heads/master
Commit: 6323af50bb751a725ab47545c95572703fe1310d
Parents: 3f5dfd4
Author: Amey Jadiye <am...@gmail.com>
Authored: Tue Jul 4 00:49:24 2017 +0530
Committer: Amey Jadiye <am...@gmail.com>
Committed: Tue Jul 4 00:49:24 2017 +0530
----------------------------------------------------------------------
src/main/java/org/apache/commons/text/WordUtils.java | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-text/blob/6323af50/src/main/java/org/apache/commons/text/WordUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/WordUtils.java b/src/main/java/org/apache/commons/text/WordUtils.java
index 0ffff07..8e96553 100644
--- a/src/main/java/org/apache/commons/text/WordUtils.java
+++ b/src/main/java/org/apache/commons/text/WordUtils.java
@@ -402,6 +402,7 @@ public class WordUtils {
* WordUtils.capitalize(*, new char[0]) = *
* WordUtils.capitalize("i am fine", null) = "I Am Fine"
* WordUtils.capitalize("i aM.fine", {'.'}) = "I aM.Fine"
+ * WordUtils.capitalize("i am fine", new char[]{}) = "I am fine"
* </pre>
*
* @param str the String to capitalize, may be null
@@ -535,6 +536,7 @@ public class WordUtils {
* WordUtils.uncapitalize(*, null) = *
* WordUtils.uncapitalize(*, new char[0]) = *
* WordUtils.uncapitalize("I AM.FINE", {'.'}) = "i AM.fINE"
+ * WordUtils.uncapitalize("I am fine", new char[]{}) = "i am fine"
* </pre>
*
* @param str the String to uncapitalize, may be null