You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2022/09/18 19:40:10 UTC

[cxf] 04/04: Fixing compilation issues (post CXF-8698 merge)

This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch 3.4.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 142c1aa054e9233135e9bdac410ad0abe72bf57a
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Sun Sep 18 15:38:16 2022 -0400

    Fixing compilation issues (post CXF-8698 merge)
    
    (cherry picked from commit 15f81404a531b9072854c417a5c0720dcbdc4684)
---
 .../main/java/org/apache/cxf/attachment/AttachmentSerializer.java    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java b/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
index decb2526d1..05e332aafc 100644
--- a/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
+++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
 import java.io.Writer;
 import java.net.URLDecoder;
 import java.net.URLEncoder;
@@ -374,7 +375,7 @@ public class AttachmentSerializer {
 
     // URL decoder would also decode '+' but according to  RFC-2392 we need to convert
     // only the % encoded character to their equivalent US-ASCII characters. 
-    private static String decode(String s, Charset charset) {
-        return URLDecoder.decode(s.replaceAll("([^%])[+]", "$1%2B"), charset);
+    private static String decode(String s, Charset charset) throws UnsupportedEncodingException {
+        return URLDecoder.decode(s.replaceAll("([^%])[+]", "$1%2B"), charset.name());
     }
 }