Skip to content

Commit 7b11dcf

Browse files
committed
Handle supplementary code points in StringUtils.splitByCharacterType()
(#1734). Javadoc
1 parent 98bc7e5 commit 7b11dcf

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

src/main/java/org/apache/commons/lang3/StringUtils.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7215,7 +7215,7 @@ public static String[] split(final String str, final String separatorChars, fina
72157215
}
72167216

72177217
/**
7218-
* Splits a String by Character type as returned by {@code java.lang.Character.getType(char)}. Groups of contiguous characters of the same type are returned
7218+
* Splits a String by Character type as returned by {@link Character#getType(int)}. Groups of contiguous characters of the same type are returned
72197219
* as complete tokens.
72207220
*
72217221
* <pre>
@@ -7232,6 +7232,7 @@ public static String[] split(final String str, final String separatorChars, fina
72327232
*
72337233
* @param str the String to split, may be {@code null}.
72347234
* @return an array of parsed Strings, {@code null} if null String input.
7235+
* @see Character#getType(int)
72357236
* @since 2.4
72367237
*/
72377238
public static String[] splitByCharacterType(final String str) {
@@ -7240,9 +7241,9 @@ public static String[] splitByCharacterType(final String str) {
72407241

72417242
/**
72427243
* Splits a String by Character type as returned by {@code java.lang.Character.getType(char)}. Groups of contiguous characters of the same type are returned
7243-
* as complete tokens, with the following exception: if {@code camelCase} is {@code true}, the character of type {@code Character.UPPERCASE_LETTER}, if any,
7244-
* immediately preceding a token of type {@code Character.LOWERCASE_LETTER} will belong to the following token rather than to the preceding, if any,
7245-
* {@code Character.UPPERCASE_LETTER} token.
7244+
* as complete tokens, with the following exception: if {@code camelCase} is {@code true}, the character of type {@link Character#UPPERCASE_LETTER}, if any,
7245+
* immediately preceding a token of type {@link Character#LOWERCASE_LETTER} will belong to the following token rather than to the preceding, if any,
7246+
* {@link Character#UPPERCASE_LETTER} token.
72467247
*
72477248
* @param str the String to split, may be {@code null}.
72487249
* @param camelCase whether to use so-called "camel-case" for letter types.
@@ -7286,9 +7287,9 @@ private static String[] splitByCharacterType(final String str, final boolean cam
72867287
}
72877288

72887289
/**
7289-
* Splits a String by Character type as returned by {@code java.lang.Character.getType(char)}. Groups of contiguous characters of the same type are returned
7290-
* as complete tokens, with the following exception: the character of type {@code Character.UPPERCASE_LETTER}, if any, immediately preceding a token of type
7291-
* {@code Character.LOWERCASE_LETTER} will belong to the following token rather than to the preceding, if any, {@code Character.UPPERCASE_LETTER} token.
7290+
* Splits a String by Character type as returned by {@link Character#getType(int)}. Groups of contiguous characters of the same type are returned
7291+
* as complete tokens, with the following exception: the character of type {@link Character#UPPERCASE_LETTER}, if any, immediately preceding a token of type
7292+
* {@link Character#LOWERCASE_LETTER} will belong to the following token rather than to the preceding, if any, {@link Character#UPPERCASE_LETTER} token.
72927293
*
72937294
* <pre>
72947295
* StringUtils.splitByCharacterTypeCamelCase(null) = null
@@ -7304,6 +7305,7 @@ private static String[] splitByCharacterType(final String str, final boolean cam
73047305
*
73057306
* @param str the String to split, may be {@code null}.
73067307
* @return an array of parsed Strings, {@code null} if null String input.
7308+
* @see Character#getType(int)
73077309
* @since 2.4
73087310
*/
73097311
public static String[] splitByCharacterTypeCamelCase(final String str) {

0 commit comments

Comments
 (0)