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 85c5713f1b5451e561f546351edc68369ed0cbd9
Author: Gary Gregory <[email protected]>
AuthorDate: Tue Jun 2 07:37:12 2026 -0400

    Reuse CharUtils.isHex()
---
 .../org/apache/commons/text/translate/NumericEntityUnescaper.java    | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/text/translate/NumericEntityUnescaper.java 
b/src/main/java/org/apache/commons/text/translate/NumericEntityUnescaper.java
index 3231e979..962995f4 100644
--- 
a/src/main/java/org/apache/commons/text/translate/NumericEntityUnescaper.java
+++ 
b/src/main/java/org/apache/commons/text/translate/NumericEntityUnescaper.java
@@ -23,6 +23,7 @@ import java.util.Collections;
 import java.util.EnumSet;
 
 import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.CharUtils;
 
 /**
  * Translates XML numeric entities of the form &amp;#[xX]?\d+;? to
@@ -123,9 +124,7 @@ public class NumericEntityUnescaper extends 
CharSequenceTranslator {
 
             int end = start;
             // Note that this supports character codes without a ; on the end
-            while (end < seqEnd && (input.charAt(end) >= '0' && 
input.charAt(end) <= '9'
-                                    || input.charAt(end) >= 'a' && 
input.charAt(end) <= 'f'
-                                    || input.charAt(end) >= 'A' && 
input.charAt(end) <= 'F')) {
+            while (end < seqEnd && CharUtils.isHex(input.charAt(end))) {
                 end++;
             }
 

Reply via email to