This is an automated email from the ASF dual-hosted git repository. garydgregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-text.git
commit 370cca35d8993fb254590dab200e9894ebd54974 Author: Gary Gregory <[email protected]> AuthorDate: Sun Jun 14 11:42:22 2026 +0000 Internal refactoring Reduce vertical space --- src/main/java/org/apache/commons/text/CaseUtils.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/apache/commons/text/CaseUtils.java b/src/main/java/org/apache/commons/text/CaseUtils.java index 075903a9..bf54e97c 100644 --- a/src/main/java/org/apache/commons/text/CaseUtils.java +++ b/src/main/java/org/apache/commons/text/CaseUtils.java @@ -34,6 +34,11 @@ import org.apache.commons.lang3.StringUtils; */ public class CaseUtils { + /** + * The code point for the space character ({@value}). + */ + private static final int CODE_POINT_SPACE = 32; + /** * Converts all the delimiter separated words in a String into camelCase, * that is each word is made up of a title case character and then a series of @@ -79,7 +84,6 @@ public class CaseUtils { boolean capitalizeNext = capitalizeFirstLetter; for (int index = 0; index < strLen;) { final int codePoint = str.codePointAt(index); - if (delimiterSet.contains(codePoint)) { capitalizeNext = outOffset != 0; index += Character.charCount(codePoint); @@ -93,7 +97,6 @@ public class CaseUtils { index += Character.charCount(codePoint); } } - return new String(newCodePoints, 0, outOffset); } @@ -106,11 +109,10 @@ public class CaseUtils { */ private static Set<Integer> toDelimiterSet(final char[] delimiters) { final Set<Integer> delimiterHashSet = new HashSet<>(); - delimiterHashSet.add(Character.codePointAt(new char[]{' '}, 0)); + delimiterHashSet.add(CODE_POINT_SPACE); if (ArrayUtils.isEmpty(delimiters)) { return delimiterHashSet; } - for (int index = 0; index < delimiters.length; index++) { delimiterHashSet.add(Character.codePointAt(delimiters, index)); }
