This is an automated email from the ASF dual-hosted git repository. coheigea pushed a commit to branch 3.6.x-fixes in repository https://gitbox.apache.org/repos/asf/cxf.git
commit 0c817e74c899a9caaefdf0bee4fa88655c4039d4 Author: Colm O hEigeartaigh <[email protected]> AuthorDate: Thu Nov 12 14:27:24 2026 +0000 Switch out HexFormat --- .../cxf/attachment/QuotedPrintableDecoderStream.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/org/apache/cxf/attachment/QuotedPrintableDecoderStream.java b/core/src/main/java/org/apache/cxf/attachment/QuotedPrintableDecoderStream.java index 950edb22b7f..244328e2154 100644 --- a/core/src/main/java/org/apache/cxf/attachment/QuotedPrintableDecoderStream.java +++ b/core/src/main/java/org/apache/cxf/attachment/QuotedPrintableDecoderStream.java @@ -20,7 +20,6 @@ package org.apache.cxf.attachment; import java.io.IOException; import java.io.InputStream; -import java.util.HexFormat; public class QuotedPrintableDecoderStream extends InputStream { // Returned by decodeNonspaceChar for a soft line break, which decodes to nothing @@ -58,12 +57,17 @@ public class QuotedPrintableDecoderStream extends InputStream { } private static int decodeHexDigit(byte b) throws IOException { - // mask to an unsigned value first so a high-bit byte is treated as a codepoint rather than indexing negatively - try { - return HexFormat.fromHexDigit(b & 0xff); - } catch (NumberFormatException e) { - throw new IOException("Invalid quoted printable encoding", e); + int digit = b & 0xff; + if (digit >= '0' && digit <= '9') { + return digit - '0'; } + if (digit >= 'A' && digit <= 'F') { + return digit - 'A' + 10; + } + if (digit >= 'a' && digit <= 'f') { + return digit - 'a' + 10; + } + throw new IOException("Invalid quoted printable encoding"); } @Override
