You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/06/10 11:56:39 UTC
[commons-lang] branch master updated: Fix camel case and comment typos.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
The following commit(s) were added to refs/heads/master by this push:
new 2da006dbb Fix camel case and comment typos.
2da006dbb is described below
commit 2da006dbbede3f18d0898819edae9a5c71eac947
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Jun 10 07:56:28 2022 -0400
Fix camel case and comment typos.
---
.../apache/commons/lang3/StringEscapeUtils.java | 4 +-
.../java/org/apache/commons/lang3/StringUtils.java | 24 ++++-----
.../lang3/text/translate/AggregateTranslator.java | 6 +--
.../text/translate/CharSequenceTranslator.java | 14 ++---
.../lang3/text/translate/CodePointTranslator.java | 10 ++--
.../lang3/text/translate/JavaUnicodeEscaper.java | 44 +++++++--------
.../lang3/text/translate/NumericEntityEscaper.java | 42 +++++++--------
.../text/translate/NumericEntityUnescaper.java | 2 +-
.../lang3/text/translate/UnicodeEscaper.java | 62 +++++++++++-----------
.../translate/UnicodeUnpairedSurrogateRemover.java | 4 +-
.../commons/lang3/StringEscapeUtilsTest.java | 2 +-
.../lang3/text/translate/LookupTranslatorTest.java | 4 +-
12 files changed, 109 insertions(+), 109 deletions(-)
diff --git a/src/main/java/org/apache/commons/lang3/StringEscapeUtils.java b/src/main/java/org/apache/commons/lang3/StringEscapeUtils.java
index efda9a6a5..9b2c8f9eb 100644
--- a/src/main/java/org/apache/commons/lang3/StringEscapeUtils.java
+++ b/src/main/java/org/apache/commons/lang3/StringEscapeUtils.java
@@ -669,7 +669,7 @@ public class StringEscapeUtils {
* </p>
*
* <p>Note that XML 1.0 is a text-only format: it cannot represent control
- * characters or unpaired Unicode surrogate codepoints, even after escaping.
+ * characters or unpaired Unicode surrogate code points, even after escaping.
* {@code escapeXml10} will remove characters that do not fit in the
* following ranges:</p>
*
@@ -701,7 +701,7 @@ public class StringEscapeUtils {
* </p>
*
* <p>XML 1.1 can represent certain control characters, but it cannot represent
- * the null byte or unpaired Unicode surrogate codepoints, even after escaping.
+ * the null byte or unpaired Unicode surrogate code points, even after escaping.
* {@code escapeXml11} will remove characters that do not fit in the following
* ranges:</p>
*
diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java b/src/main/java/org/apache/commons/lang3/StringUtils.java
index 599801e47..5d40563bf 100644
--- a/src/main/java/org/apache/commons/lang3/StringUtils.java
+++ b/src/main/java/org/apache/commons/lang3/StringUtils.java
@@ -554,11 +554,11 @@ public class StringUtils {
final int[] newCodePoints = new int[strLen]; // cannot be longer than the char array
int outOffset = 0;
- newCodePoints[outOffset++] = newCodePoint; // copy the first codepoint
+ newCodePoints[outOffset++] = newCodePoint; // copy the first code point
for (int inOffset = Character.charCount(firstCodepoint); inOffset < strLen; ) {
- final int codepoint = str.codePointAt(inOffset);
- newCodePoints[outOffset++] = codepoint; // copy the remaining ones
- inOffset += Character.charCount(codepoint);
+ final int codePoint = str.codePointAt(inOffset);
+ newCodePoints[outOffset++] = codePoint; // copy the remaining ones
+ inOffset += Character.charCount(codePoint);
}
return new String(newCodePoints, 0, outOffset);
}
@@ -9335,20 +9335,20 @@ public class StringUtils {
return str;
}
- final int firstCodepoint = str.codePointAt(0);
- final int newCodePoint = Character.toLowerCase(firstCodepoint);
- if (firstCodepoint == newCodePoint) {
+ final int firstCodePoint = str.codePointAt(0);
+ final int newCodePoint = Character.toLowerCase(firstCodePoint);
+ if (firstCodePoint == newCodePoint) {
// already capitalized
return str;
}
final int[] newCodePoints = new int[strLen]; // cannot be longer than the char array
int outOffset = 0;
- newCodePoints[outOffset++] = newCodePoint; // copy the first codepoint
- for (int inOffset = Character.charCount(firstCodepoint); inOffset < strLen; ) {
- final int codepoint = str.codePointAt(inOffset);
- newCodePoints[outOffset++] = codepoint; // copy the remaining ones
- inOffset += Character.charCount(codepoint);
+ newCodePoints[outOffset++] = newCodePoint; // copy the first code point
+ for (int inOffset = Character.charCount(firstCodePoint); inOffset < strLen; ) {
+ final int codePoint = str.codePointAt(inOffset);
+ newCodePoints[outOffset++] = codePoint; // copy the remaining ones
+ inOffset += Character.charCount(codePoint);
}
return new String(newCodePoints, 0, outOffset);
}
diff --git a/src/main/java/org/apache/commons/lang3/text/translate/AggregateTranslator.java b/src/main/java/org/apache/commons/lang3/text/translate/AggregateTranslator.java
index 05e917544..1450b2e3b 100644
--- a/src/main/java/org/apache/commons/lang3/text/translate/AggregateTranslator.java
+++ b/src/main/java/org/apache/commons/lang3/text/translate/AggregateTranslator.java
@@ -23,7 +23,7 @@ import org.apache.commons.lang3.ArrayUtils;
/**
* Executes a sequence of translators one after the other. Execution ends whenever
- * the first translator consumes codepoints from the input.
+ * the first translator consumes code points from the input.
*
* @since 3.0
* @deprecated As of 3.6, use Apache Commons Text
@@ -45,8 +45,8 @@ public class AggregateTranslator extends CharSequenceTranslator {
}
/**
- * The first translator to consume codepoints from the input is the 'winner'.
- * Execution stops with the number of consumed codepoints being returned.
+ * The first translator to consume code points from the input is the 'winner'.
+ * Execution stops with the number of consumed code points being returned.
* {@inheritDoc}
*/
@Override
diff --git a/src/main/java/org/apache/commons/lang3/text/translate/CharSequenceTranslator.java b/src/main/java/org/apache/commons/lang3/text/translate/CharSequenceTranslator.java
index a60ba85d4..0418adaaa 100644
--- a/src/main/java/org/apache/commons/lang3/text/translate/CharSequenceTranslator.java
+++ b/src/main/java/org/apache/commons/lang3/text/translate/CharSequenceTranslator.java
@@ -37,15 +37,15 @@ public abstract class CharSequenceTranslator {
static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
/**
- * Translate a set of codepoints, represented by an int index into a CharSequence,
- * into another set of codepoints. The number of codepoints consumed must be returned,
+ * Translate a set of code points, represented by an int index into a CharSequence,
+ * into another set of code points. The number of code points consumed must be returned,
* and the only IOExceptions thrown must be from interacting with the Writer so that
* the top level API may reliably ignore StringWriter IOExceptions.
*
* @param input CharSequence that is being translated
* @param index int representing the current point of translation
* @param out Writer to translate the text to
- * @return int count of codepoints consumed
+ * @return int count of code points consumed
* @throws IOException if and only if the Writer produces an IOException
*/
public abstract int translate(CharSequence input, int index, Writer out) throws IOException;
@@ -103,7 +103,7 @@ public abstract class CharSequenceTranslator {
}
continue;
}
- // contract with translators is that they have to understand codepoints
+ // contract with translators is that they have to understand code points
// and they just took care of a surrogate pair
for (int pt = 0; pt < consumed; pt++) {
pos += Character.charCount(Character.codePointAt(input, pos));
@@ -129,11 +129,11 @@ public abstract class CharSequenceTranslator {
* <p>Returns an upper case hexadecimal {@code String} for the given
* character.</p>
*
- * @param codepoint The codepoint to convert.
+ * @param codePoint The code point to convert.
* @return An upper case hexadecimal {@code String}
*/
- public static String hex(final int codepoint) {
- return Integer.toHexString(codepoint).toUpperCase(Locale.ENGLISH);
+ public static String hex(final int codePoint) {
+ return Integer.toHexString(codePoint).toUpperCase(Locale.ENGLISH);
}
}
diff --git a/src/main/java/org/apache/commons/lang3/text/translate/CodePointTranslator.java b/src/main/java/org/apache/commons/lang3/text/translate/CodePointTranslator.java
index c70a21508..e315fad5b 100644
--- a/src/main/java/org/apache/commons/lang3/text/translate/CodePointTranslator.java
+++ b/src/main/java/org/apache/commons/lang3/text/translate/CodePointTranslator.java
@@ -37,19 +37,19 @@ public abstract class CodePointTranslator extends CharSequenceTranslator {
*/
@Override
public final int translate(final CharSequence input, final int index, final Writer out) throws IOException {
- final int codepoint = Character.codePointAt(input, index);
- final boolean consumed = translate(codepoint, out);
+ final int codePoint = Character.codePointAt(input, index);
+ final boolean consumed = translate(codePoint, out);
return consumed ? 1 : 0;
}
/**
- * Translate the specified codepoint into another.
+ * Translate the specified code point into another.
*
- * @param codepoint int character input to translate
+ * @param codePoint int character input to translate
* @param out Writer to optionally push the translated output to
* @return boolean as to whether translation occurred or not
* @throws IOException if and only if the Writer produces an IOException
*/
- public abstract boolean translate(int codepoint, Writer out) throws IOException;
+ public abstract boolean translate(int codePoint, Writer out) throws IOException;
}
diff --git a/src/main/java/org/apache/commons/lang3/text/translate/JavaUnicodeEscaper.java b/src/main/java/org/apache/commons/lang3/text/translate/JavaUnicodeEscaper.java
index 0d5664bdb..28f662ea9 100644
--- a/src/main/java/org/apache/commons/lang3/text/translate/JavaUnicodeEscaper.java
+++ b/src/main/java/org/apache/commons/lang3/text/translate/JavaUnicodeEscaper.java
@@ -17,7 +17,7 @@
package org.apache.commons.lang3.text.translate;
/**
- * Translates codepoints to their Unicode escaped value suitable for Java source.
+ * Translates code points to their Unicode escaped value suitable for Java source.
*
* @since 3.2
* @deprecated As of 3.6, use Apache Commons Text
@@ -32,12 +32,12 @@ public class JavaUnicodeEscaper extends UnicodeEscaper {
* Constructs a {@code JavaUnicodeEscaper} above the specified value (exclusive).
* </p>
*
- * @param codepoint
+ * @param codePoint
* above which to escape
* @return the newly created {@code UnicodeEscaper} instance
*/
- public static JavaUnicodeEscaper above(final int codepoint) {
- return outsideOf(0, codepoint);
+ public static JavaUnicodeEscaper above(final int codePoint) {
+ return outsideOf(0, codePoint);
}
/**
@@ -45,12 +45,12 @@ public class JavaUnicodeEscaper extends UnicodeEscaper {
* Constructs a {@code JavaUnicodeEscaper} below the specified value (exclusive).
* </p>
*
- * @param codepoint
+ * @param codePoint
* below which to escape
* @return the newly created {@code UnicodeEscaper} instance
*/
- public static JavaUnicodeEscaper below(final int codepoint) {
- return outsideOf(codepoint, Integer.MAX_VALUE);
+ public static JavaUnicodeEscaper below(final int codePoint) {
+ return outsideOf(codePoint, Integer.MAX_VALUE);
}
/**
@@ -58,14 +58,14 @@ public class JavaUnicodeEscaper extends UnicodeEscaper {
* Constructs a {@code JavaUnicodeEscaper} between the specified values (inclusive).
* </p>
*
- * @param codepointLow
+ * @param codePointLow
* above which to escape
- * @param codepointHigh
+ * @param codePointHigh
* below which to escape
* @return the newly created {@code UnicodeEscaper} instance
*/
- public static JavaUnicodeEscaper between(final int codepointLow, final int codepointHigh) {
- return new JavaUnicodeEscaper(codepointLow, codepointHigh, true);
+ public static JavaUnicodeEscaper between(final int codePointLow, final int codePointHigh) {
+ return new JavaUnicodeEscaper(codePointLow, codePointHigh, true);
}
/**
@@ -73,14 +73,14 @@ public class JavaUnicodeEscaper extends UnicodeEscaper {
* Constructs a {@code JavaUnicodeEscaper} outside of the specified values (exclusive).
* </p>
*
- * @param codepointLow
+ * @param codePointLow
* below which to escape
- * @param codepointHigh
+ * @param codePointHigh
* above which to escape
* @return the newly created {@code UnicodeEscaper} instance
*/
- public static JavaUnicodeEscaper outsideOf(final int codepointLow, final int codepointHigh) {
- return new JavaUnicodeEscaper(codepointLow, codepointHigh, false);
+ public static JavaUnicodeEscaper outsideOf(final int codePointLow, final int codePointHigh) {
+ return new JavaUnicodeEscaper(codePointLow, codePointHigh, false);
}
/**
@@ -91,9 +91,9 @@ public class JavaUnicodeEscaper extends UnicodeEscaper {
* </p>
*
* @param below
- * int value representing the lowest codepoint boundary
+ * int value representing the lowest code point boundary
* @param above
- * int value representing the highest codepoint boundary
+ * int value representing the highest code point boundary
* @param between
* whether to escape between the boundaries or outside them
*/
@@ -102,15 +102,15 @@ public class JavaUnicodeEscaper extends UnicodeEscaper {
}
/**
- * Converts the given codepoint to a hex string of the form {@code "\\uXXXX\\uXXXX"}
+ * Converts the given code point to a hex string of the form {@code "\\uXXXX\\uXXXX"}
*
- * @param codepoint
+ * @param codePoint
* a Unicode code point
- * @return the hex string for the given codepoint
+ * @return the hex string for the given code point
*/
@Override
- protected String toUtf16Escape(final int codepoint) {
- final char[] surrogatePair = Character.toChars(codepoint);
+ protected String toUtf16Escape(final int codePoint) {
+ final char[] surrogatePair = Character.toChars(codePoint);
return "\\u" + hex(surrogatePair[0]) + "\\u" + hex(surrogatePair[1]);
}
diff --git a/src/main/java/org/apache/commons/lang3/text/translate/NumericEntityEscaper.java b/src/main/java/org/apache/commons/lang3/text/translate/NumericEntityEscaper.java
index 7886cc758..9777e0cfa 100644
--- a/src/main/java/org/apache/commons/lang3/text/translate/NumericEntityEscaper.java
+++ b/src/main/java/org/apache/commons/lang3/text/translate/NumericEntityEscaper.java
@@ -20,7 +20,7 @@ import java.io.IOException;
import java.io.Writer;
/**
- * Translates codepoints to their XML numeric entity escaped value.
+ * Translates code points to their XML numeric entity escaped value.
*
* @since 3.0
* @deprecated As of 3.6, use Apache Commons Text
@@ -40,8 +40,8 @@ public class NumericEntityEscaper extends CodePointTranslator {
* and {@code above} boundaries are inclusive when {@code between} is
* {@code true} and exclusive when it is {@code false}. </p>
*
- * @param below int value representing the lowest codepoint boundary
- * @param above int value representing the highest codepoint boundary
+ * @param below int value representing the lowest code point boundary
+ * @param above int value representing the highest code point boundary
* @param between whether to escape between the boundaries or outside them
*/
private NumericEntityEscaper(final int below, final int above, final boolean between) {
@@ -60,60 +60,60 @@ public class NumericEntityEscaper extends CodePointTranslator {
/**
* <p>Constructs a {@code NumericEntityEscaper} below the specified value (exclusive). </p>
*
- * @param codepoint below which to escape
+ * @param codePoint below which to escape
* @return the newly created {@code NumericEntityEscaper} instance
*/
- public static NumericEntityEscaper below(final int codepoint) {
- return outsideOf(codepoint, Integer.MAX_VALUE);
+ public static NumericEntityEscaper below(final int codePoint) {
+ return outsideOf(codePoint, Integer.MAX_VALUE);
}
/**
* <p>Constructs a {@code NumericEntityEscaper} above the specified value (exclusive). </p>
*
- * @param codepoint above which to escape
+ * @param codePoint above which to escape
* @return the newly created {@code NumericEntityEscaper} instance
*/
- public static NumericEntityEscaper above(final int codepoint) {
- return outsideOf(0, codepoint);
+ public static NumericEntityEscaper above(final int codePoint) {
+ return outsideOf(0, codePoint);
}
/**
* <p>Constructs a {@code NumericEntityEscaper} between the specified values (inclusive). </p>
*
- * @param codepointLow above which to escape
- * @param codepointHigh below which to escape
+ * @param codePointLow above which to escape
+ * @param codePointHigh below which to escape
* @return the newly created {@code NumericEntityEscaper} instance
*/
- public static NumericEntityEscaper between(final int codepointLow, final int codepointHigh) {
- return new NumericEntityEscaper(codepointLow, codepointHigh, true);
+ public static NumericEntityEscaper between(final int codePointLow, final int codePointHigh) {
+ return new NumericEntityEscaper(codePointLow, codePointHigh, true);
}
/**
* <p>Constructs a {@code NumericEntityEscaper} outside of the specified values (exclusive). </p>
*
- * @param codepointLow below which to escape
- * @param codepointHigh above which to escape
+ * @param codePointLow below which to escape
+ * @param codePointHigh above which to escape
* @return the newly created {@code NumericEntityEscaper} instance
*/
- public static NumericEntityEscaper outsideOf(final int codepointLow, final int codepointHigh) {
- return new NumericEntityEscaper(codepointLow, codepointHigh, false);
+ public static NumericEntityEscaper outsideOf(final int codePointLow, final int codePointHigh) {
+ return new NumericEntityEscaper(codePointLow, codePointHigh, false);
}
/**
* {@inheritDoc}
*/
@Override
- public boolean translate(final int codepoint, final Writer out) throws IOException {
+ public boolean translate(final int codePoint, final Writer out) throws IOException {
if (between) {
- if (codepoint < below || codepoint > above) {
+ if (codePoint < below || codePoint > above) {
return false;
}
- } else if (codepoint >= below && codepoint <= above) {
+ } else if (codePoint >= below && codePoint <= above) {
return false;
}
out.write("&#");
- out.write(Integer.toString(codepoint, 10));
+ out.write(Integer.toString(codePoint, 10));
out.write(';');
return true;
}
diff --git a/src/main/java/org/apache/commons/lang3/text/translate/NumericEntityUnescaper.java b/src/main/java/org/apache/commons/lang3/text/translate/NumericEntityUnescaper.java
index 1059636bc..a238c9d43 100644
--- a/src/main/java/org/apache/commons/lang3/text/translate/NumericEntityUnescaper.java
+++ b/src/main/java/org/apache/commons/lang3/text/translate/NumericEntityUnescaper.java
@@ -24,7 +24,7 @@ import java.util.EnumSet;
/**
* Translate XML numeric entities of the form &#[xX]?\d+;? to
- * the specific codepoint.
+ * the specific code point.
*
* Note that the semicolon is optional.
*
diff --git a/src/main/java/org/apache/commons/lang3/text/translate/UnicodeEscaper.java b/src/main/java/org/apache/commons/lang3/text/translate/UnicodeEscaper.java
index 73ca0cfec..dea5a20a2 100644
--- a/src/main/java/org/apache/commons/lang3/text/translate/UnicodeEscaper.java
+++ b/src/main/java/org/apache/commons/lang3/text/translate/UnicodeEscaper.java
@@ -20,7 +20,7 @@ import java.io.IOException;
import java.io.Writer;
/**
- * Translates codepoints to their Unicode escaped value.
+ * Translates code points to their Unicode escaped value.
*
* @since 3.0
* @deprecated As of 3.6, use Apache Commons Text
@@ -47,8 +47,8 @@ public class UnicodeEscaper extends CodePointTranslator {
* and {@code above} boundaries are inclusive when {@code between} is
* {@code true} and exclusive when it is {@code false}. </p>
*
- * @param below int value representing the lowest codepoint boundary
- * @param above int value representing the highest codepoint boundary
+ * @param below int value representing the lowest code point boundary
+ * @param above int value representing the highest code point boundary
* @param between whether to escape between the boundaries or outside them
*/
protected UnicodeEscaper(final int below, final int above, final boolean between) {
@@ -60,81 +60,81 @@ public class UnicodeEscaper extends CodePointTranslator {
/**
* <p>Constructs a {@code UnicodeEscaper} below the specified value (exclusive). </p>
*
- * @param codepoint below which to escape
+ * @param codePoint below which to escape
* @return the newly created {@code UnicodeEscaper} instance
*/
- public static UnicodeEscaper below(final int codepoint) {
- return outsideOf(codepoint, Integer.MAX_VALUE);
+ public static UnicodeEscaper below(final int codePoint) {
+ return outsideOf(codePoint, Integer.MAX_VALUE);
}
/**
* <p>Constructs a {@code UnicodeEscaper} above the specified value (exclusive). </p>
*
- * @param codepoint above which to escape
+ * @param codePoint above which to escape
* @return the newly created {@code UnicodeEscaper} instance
*/
- public static UnicodeEscaper above(final int codepoint) {
- return outsideOf(0, codepoint);
+ public static UnicodeEscaper above(final int codePoint) {
+ return outsideOf(0, codePoint);
}
/**
* <p>Constructs a {@code UnicodeEscaper} outside of the specified values (exclusive). </p>
*
- * @param codepointLow below which to escape
- * @param codepointHigh above which to escape
+ * @param codePointLow below which to escape
+ * @param codePointHigh above which to escape
* @return the newly created {@code UnicodeEscaper} instance
*/
- public static UnicodeEscaper outsideOf(final int codepointLow, final int codepointHigh) {
- return new UnicodeEscaper(codepointLow, codepointHigh, false);
+ public static UnicodeEscaper outsideOf(final int codePointLow, final int codePointHigh) {
+ return new UnicodeEscaper(codePointLow, codePointHigh, false);
}
/**
* <p>Constructs a {@code UnicodeEscaper} between the specified values (inclusive). </p>
*
- * @param codepointLow above which to escape
- * @param codepointHigh below which to escape
+ * @param codePointLow above which to escape
+ * @param codePointHigh below which to escape
* @return the newly created {@code UnicodeEscaper} instance
*/
- public static UnicodeEscaper between(final int codepointLow, final int codepointHigh) {
- return new UnicodeEscaper(codepointLow, codepointHigh, true);
+ public static UnicodeEscaper between(final int codePointLow, final int codePointHigh) {
+ return new UnicodeEscaper(codePointLow, codePointHigh, true);
}
/**
* {@inheritDoc}
*/
@Override
- public boolean translate(final int codepoint, final Writer out) throws IOException {
+ public boolean translate(final int codePoint, final Writer out) throws IOException {
if (between) {
- if (codepoint < below || codepoint > above) {
+ if (codePoint < below || codePoint > above) {
return false;
}
- } else if (codepoint >= below && codepoint <= above) {
+ } else if (codePoint >= below && codePoint <= above) {
return false;
}
// TODO: Handle potential + sign per various Unicode escape implementations
- if (codepoint > 0xffff) {
- out.write(toUtf16Escape(codepoint));
+ if (codePoint > 0xffff) {
+ out.write(toUtf16Escape(codePoint));
} else {
out.write("\\u");
- out.write(HEX_DIGITS[(codepoint >> 12) & 15]);
- out.write(HEX_DIGITS[(codepoint >> 8) & 15]);
- out.write(HEX_DIGITS[(codepoint >> 4) & 15]);
- out.write(HEX_DIGITS[(codepoint) & 15]);
+ out.write(HEX_DIGITS[(codePoint >> 12) & 15]);
+ out.write(HEX_DIGITS[(codePoint >> 8) & 15]);
+ out.write(HEX_DIGITS[(codePoint >> 4) & 15]);
+ out.write(HEX_DIGITS[(codePoint) & 15]);
}
return true;
}
/**
- * Converts the given codepoint to a hex string of the form {@code "\\uXXXX"}
+ * Converts the given code point to a hex string of the form {@code "\\uXXXX"}
*
- * @param codepoint
+ * @param codePoint
* a Unicode code point
- * @return the hex string for the given codepoint
+ * @return the hex string for the given code point
*
* @since 3.2
*/
- protected String toUtf16Escape(final int codepoint) {
- return "\\u" + hex(codepoint);
+ protected String toUtf16Escape(final int codePoint) {
+ return "\\u" + hex(codePoint);
}
}
diff --git a/src/main/java/org/apache/commons/lang3/text/translate/UnicodeUnpairedSurrogateRemover.java b/src/main/java/org/apache/commons/lang3/text/translate/UnicodeUnpairedSurrogateRemover.java
index f16f191a1..d054742f1 100644
--- a/src/main/java/org/apache/commons/lang3/text/translate/UnicodeUnpairedSurrogateRemover.java
+++ b/src/main/java/org/apache/commons/lang3/text/translate/UnicodeUnpairedSurrogateRemover.java
@@ -33,9 +33,9 @@ public class UnicodeUnpairedSurrogateRemover extends CodePointTranslator {
* {@inheritDoc}
*/
@Override
- public boolean translate(final int codepoint, final Writer out) throws IOException {
+ public boolean translate(final int codePoint, final Writer out) throws IOException {
// true: It's a surrogate. Write nothing and say we've translated.
- return codepoint >= Character.MIN_SURROGATE && codepoint <= Character.MAX_SURROGATE;
+ return codePoint >= Character.MIN_SURROGATE && codePoint <= Character.MAX_SURROGATE;
// It's not a surrogate. Don't translate it.
}
}
diff --git a/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java b/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java
index ac9116b41..80e04fbda 100644
--- a/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java
@@ -473,7 +473,7 @@ public class StringEscapeUtilsTest {
// this is the utf8 representation of the character:
// COUNTING ROD UNIT DIGIT THREE
// in Unicode
- // codepoint: U+1D362
+ // code point: U+1D362
final byte[] data = { (byte) 0xF0, (byte) 0x9D, (byte) 0x8D, (byte) 0xA2 };
final String original = new String(data, StandardCharsets.UTF_8);
diff --git a/src/test/java/org/apache/commons/lang3/text/translate/LookupTranslatorTest.java b/src/test/java/org/apache/commons/lang3/text/translate/LookupTranslatorTest.java
index 7235a62b6..5f92050cb 100644
--- a/src/test/java/org/apache/commons/lang3/text/translate/LookupTranslatorTest.java
+++ b/src/test/java/org/apache/commons/lang3/text/translate/LookupTranslatorTest.java
@@ -35,7 +35,7 @@ public class LookupTranslatorTest {
final LookupTranslator lt = new LookupTranslator(new CharSequence[][] { { "one", "two" } });
final StringWriter out = new StringWriter();
final int result = lt.translate("one", 0, out);
- assertEquals(3, result, "Incorrect codepoint consumption");
+ assertEquals(3, result, "Incorrect code point consumption");
assertEquals("two", out.toString(), "Incorrect value");
}
@@ -45,7 +45,7 @@ public class LookupTranslatorTest {
final LookupTranslator lt = new LookupTranslator(new CharSequence[][] { { new StringBuffer("one"), new StringBuffer("two") } });
final StringWriter out = new StringWriter();
final int result = lt.translate(new StringBuffer("one"), 0, out);
- assertEquals(3, result, "Incorrect codepoint consumption");
+ assertEquals(3, result, "Incorrect code point consumption");
assertEquals("two", out.toString(), "Incorrect value");
}