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

reschke pushed a commit to branch SLING-13260
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resourceresolver.git


The following commit(s) were added to refs/heads/SLING-13260 by this push:
     new f1a47db3 SLING-13260 adding CharSet to instantiate the String (#211)
f1a47db3 is described below

commit f1a47db3642c4231ceb1378a216501565ed9a824
Author: Patrique Legault <[email protected]>
AuthorDate: Thu Jul 9 10:51:18 2026 -0400

    SLING-13260 adding CharSet to instantiate the String (#211)
    
    Co-authored-by: patlego <[email protected]>
---
 .../java/org/apache/sling/resourceresolver/impl/helper/URI.java    | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git 
a/src/main/java/org/apache/sling/resourceresolver/impl/helper/URI.java 
b/src/main/java/org/apache/sling/resourceresolver/impl/helper/URI.java
index f9c81020..742c17b3 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/helper/URI.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/helper/URI.java
@@ -24,6 +24,7 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
 import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.BitSet;
 import java.util.HashMap;
@@ -4018,11 +4019,7 @@ public class URI implements Cloneable, Comparable<URI>, 
Serializable {
             throw new IllegalArgumentException("Parameter may not be null");
         }
 
-        try {
-            return new String(data, "US-ASCII");
-        } catch (UnsupportedEncodingException e) {
-            throw new URIException("HttpClient requires ASCII support");
-        }
+        return new String(data, StandardCharsets.US_ASCII);
     }
 
     /**

Reply via email to