cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [2/3] cxf git commit: Switch to use StandardCharset.UTF_8 instead of string literal
Date Tue, 10 Nov 2015 17:19:55 GMT
http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
index aa051c6..856d02f 100644
--- a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
+++ b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
@@ -25,6 +25,7 @@ import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
 import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -121,8 +122,8 @@ public class JAXRSUtilsTest extends Assert {
     @Test
     public void testFormParametersUTF8Encoding() throws Exception {
         JAXRSUtils.intersectMimeTypes("application/json", "application/json+v2");
-        doTestFormParamsWithEncoding("UTF-8", true);
-        doTestFormParamsWithEncoding("UTF-8", false);
+        doTestFormParamsWithEncoding(StandardCharsets.UTF_8.name(), true);
+        doTestFormParamsWithEncoding(StandardCharsets.UTF_8.name(), false);
     }
     
     @Test

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
index 55e0a26..7eeb9c2 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
@@ -25,6 +25,7 @@ import java.awt.image.BufferedImage;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.lang.reflect.Method;
+import java.nio.charset.StandardCharsets;
 import java.security.AccessController;
 import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
@@ -226,11 +227,7 @@ public class SwAOutInterceptor extends AbstractSoapInterceptor {
                 if (ct == null) {
                     ct = "text/plain; charset=\'UTF-8\'";
                 }
-                try {
-                    dh = new DataHandler(new ByteDataSource(((String)o).getBytes("UTF-8"), ct));
-                } catch (IOException e) {
-                    throw new Fault(e);
-                }                
+                dh = new DataHandler(new ByteDataSource(((String)o).getBytes(StandardCharsets.UTF_8), ct));
             } else {
                 throw new Fault(new org.apache.cxf.common.i18n.Message("ATTACHMENT_NOT_SUPPORTED", 
                                                                        LOG, o.getClass()));
@@ -260,7 +257,7 @@ public class SwAOutInterceptor extends AbstractSoapInterceptor {
                     IOUtils.copy(src.getInputStream(), bos, 1024);
                     ds = new ByteDataSource(bos.toByteArray(), ct);
                 } else {
-                    ds = new ByteDataSource(IOUtils.toString(src.getReader()).getBytes("UTF-8"),
+                    ds = new ByteDataSource(IOUtils.toString(src.getReader()).getBytes(StandardCharsets.UTF_8),
                                                  ct);                            
                 }
             } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/frontend/js/src/main/java/org/apache/cxf/js/rhino/JsServiceFactoryBean.java
----------------------------------------------------------------------
diff --git a/rt/frontend/js/src/main/java/org/apache/cxf/js/rhino/JsServiceFactoryBean.java b/rt/frontend/js/src/main/java/org/apache/cxf/js/rhino/JsServiceFactoryBean.java
index db079d7..b9221d6 100644
--- a/rt/frontend/js/src/main/java/org/apache/cxf/js/rhino/JsServiceFactoryBean.java
+++ b/rt/frontend/js/src/main/java/org/apache/cxf/js/rhino/JsServiceFactoryBean.java
@@ -21,6 +21,7 @@ package org.apache.cxf.js.rhino;
 
 import java.io.File;
 import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
@@ -74,7 +75,7 @@ public class JsServiceFactoryBean {
     public void create() throws Exception {
         BusFactory.setDefaultBus(bus);
         String jsFileString = getClass().getResource(js).toURI().getPath();
-        jsFileString = URLDecoder.decode(jsFileString, "UTF-8");
+        jsFileString = URLDecoder.decode(jsFileString, StandardCharsets.UTF_8.name());
         File file = new File(jsFileString);
         providerFactory.createAndPublish(file, address, isBaseAddr);
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisElementProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisElementProvider.java b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisElementProvider.java
index c8fc34e..e0aa712 100644
--- a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisElementProvider.java
+++ b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisElementProvider.java
@@ -26,6 +26,7 @@ import java.io.OutputStream;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
+import java.nio.charset.StandardCharsets;
 
 import javax.ws.rs.Consumes;
 import javax.ws.rs.Produces;
@@ -113,7 +114,7 @@ public class AegisElementProvider<T> extends AbstractAegisProvider<T>  {
         AegisType aegisType = context.getTypeMapping().getType(genericType);
         AegisWriter<XMLStreamWriter> aegisWriter = context.createXMLStreamWriter();
         try {
-            String enc = HttpUtils.getSetEncoding(m, headers, "UTF-8");
+            String enc = HttpUtils.getSetEncoding(m, headers, StandardCharsets.UTF_8.name());
             XMLStreamWriter xmlStreamWriter = createStreamWriter(aegisType.getSchemaType(), enc, os);
             // use type qname as element qname?
             xmlStreamWriter.writeStartDocument();

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisJSONProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisJSONProvider.java b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisJSONProvider.java
index 3bf5894..0a2591a 100644
--- a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisJSONProvider.java
+++ b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisJSONProvider.java
@@ -24,6 +24,7 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
+import java.nio.charset.StandardCharsets;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
@@ -114,7 +115,7 @@ public final class AegisJSONProvider<T> extends AegisElementProvider<T> {
             Document dom = w3cStreamWriter.getDocument();
             // ok, now the namespace map has all the prefixes.
             
-            String enc = HttpUtils.getSetEncoding(m, headers, "UTF-8");
+            String enc = HttpUtils.getSetEncoding(m, headers, StandardCharsets.UTF_8.name());
             
             XMLStreamWriter xmlStreamWriter = createStreamWriter(aegisType.getSchemaType(), enc, os);
             xmlStreamWriter.writeStartDocument();

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java
index 2a53be9..24f694f 100644
--- a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java
+++ b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java
@@ -30,6 +30,7 @@ import java.io.StringReader;
 import java.io.Writer;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
+import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Enumeration;
@@ -216,7 +217,7 @@ public class JSONProvider<T> extends AbstractJAXBProvider<T>  {
         }
         
         XMLStreamReader reader = null;
-        String enc = HttpUtils.getEncoding(mt, "UTF-8");
+        String enc = HttpUtils.getEncoding(mt, StandardCharsets.UTF_8.name());
         Unmarshaller unmarshaller = null;
         try {
             InputStream realStream = getInputStream(type, genericType, is);
@@ -374,7 +375,7 @@ public class JSONProvider<T> extends AbstractJAXBProvider<T>  {
         XMLStreamWriter writer = null;
         try {
             
-            String enc = HttpUtils.getSetEncoding(m, headers, "UTF-8");
+            String enc = HttpUtils.getSetEncoding(m, headers, StandardCharsets.UTF_8.name());
             if (Document.class.isAssignableFrom(cls)) {
                 writer = createWriter(obj, cls, genericType, enc, os, false);
                 copyReaderToWriter(StaxUtils.createXMLStreamReader((Document)obj), writer);

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/utils/JSONUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/utils/JSONUtils.java b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/utils/JSONUtils.java
index 6c37267..1e99871 100644
--- a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/utils/JSONUtils.java
+++ b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/utils/JSONUtils.java
@@ -21,6 +21,7 @@ package org.apache.cxf.jaxrs.provider.json.utils;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
+import java.nio.charset.StandardCharsets;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -135,7 +136,7 @@ public final class JSONUtils {
     
     public static XMLStreamReader createStreamReader(InputStream is, boolean readXsiType,
         ConcurrentHashMap<String, String> namespaceMap) throws Exception {
-        return createStreamReader(is, readXsiType, namespaceMap, null, null, null, "UTF-8");
+        return createStreamReader(is, readXsiType, namespaceMap, null, null, null, StandardCharsets.UTF_8.name());
     }
     
     public static XMLStreamReader createStreamReader(InputStream is, boolean readXsiType,

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/jsonp/AbstractJsonpOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/jsonp/AbstractJsonpOutInterceptor.java b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/jsonp/AbstractJsonpOutInterceptor.java
index 2760488..2c1a807 100644
--- a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/jsonp/AbstractJsonpOutInterceptor.java
+++ b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/jsonp/AbstractJsonpOutInterceptor.java
@@ -21,6 +21,7 @@ package org.apache.cxf.jaxrs.provider.jsonp;
 
 import java.io.IOException;
 import java.io.OutputStream;
+import java.nio.charset.StandardCharsets;
 
 import javax.servlet.http.HttpServletResponse;
 
@@ -42,7 +43,7 @@ public abstract class AbstractJsonpOutInterceptor extends AbstractPhaseIntercept
     
     protected void writeValue(Message message, String value) throws Fault {
         try {
-            getOutputStream(message).write(value.getBytes("UTF-8"));
+            getOutputStream(message).write(value.getBytes(StandardCharsets.UTF_8));
         } catch (IOException e) {
             throw new Fault(e);
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/jsonp/JsonpJaxrsWriterInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/jsonp/JsonpJaxrsWriterInterceptor.java b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/jsonp/JsonpJaxrsWriterInterceptor.java
index 2086d6c..6322964 100644
--- a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/jsonp/JsonpJaxrsWriterInterceptor.java
+++ b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/jsonp/JsonpJaxrsWriterInterceptor.java
@@ -20,6 +20,7 @@
 package org.apache.cxf.jaxrs.provider.jsonp;
 
 import java.io.IOException;
+import java.nio.charset.StandardCharsets;
 
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.ext.WriterInterceptor;
@@ -47,7 +48,7 @@ public class JsonpJaxrsWriterInterceptor implements WriterInterceptor {
         if (!StringUtils.isEmpty(callback)) {
             context.getHeaders().putSingle(Message.CONTENT_TYPE, 
                                            JAXRSUtils.toMediaType(getMediaType()));
-            context.getOutputStream().write((callback + getPaddingEnd()).getBytes("UTF-8"));
+            context.getOutputStream().write((callback + getPaddingEnd()).getBytes(StandardCharsets.UTF_8));
         }
         context.proceed();
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/atom/AtomPojoProviderTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/atom/AtomPojoProviderTest.java b/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/atom/AtomPojoProviderTest.java
index 934f763..0296764 100644
--- a/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/atom/AtomPojoProviderTest.java
+++ b/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/atom/AtomPojoProviderTest.java
@@ -22,7 +22,7 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.StringReader;
 import java.lang.annotation.Annotation;
-import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -197,7 +197,7 @@ public class AtomPojoProviderTest extends Assert {
                                   new Annotation[0],
                                   MediaType.valueOf("application/atom+xml;type=entry"),
                                   new MetadataMap<String, String>(),
-                                  new ByteArrayInputStream(entryNoContent.getBytes(Charset.forName("UTF-8"))));
+                                  new ByteArrayInputStream(entryNoContent.getBytes(StandardCharsets.UTF_8)));
         assertNull(type);
     }
     
@@ -231,7 +231,7 @@ public class AtomPojoProviderTest extends Assert {
                                   new Annotation[0],
                                   MediaType.valueOf(mediaType),
                                   new MetadataMap<String, String>(),
-                                  new ByteArrayInputStream(entryWithContent.getBytes(Charset.forName("UTF-8"))));
+                                  new ByteArrayInputStream(entryWithContent.getBytes(StandardCharsets.UTF_8)));
         assertNotNull(type);
     }
     

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/dom4j/DOM4JProviderTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/dom4j/DOM4JProviderTest.java b/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/dom4j/DOM4JProviderTest.java
index f4fa478..a0912a0 100644
--- a/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/dom4j/DOM4JProviderTest.java
+++ b/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/dom4j/DOM4JProviderTest.java
@@ -21,6 +21,7 @@ package org.apache.cxf.jaxrs.provider.dom4j;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.lang.annotation.Annotation;
+import java.nio.charset.StandardCharsets;
 
 import javax.ws.rs.core.Application;
 import javax.ws.rs.core.MediaType;
@@ -58,7 +59,7 @@ public class DOM4JProviderTest extends Assert {
         p.setProviders(new ProvidersImpl(createMessage(false)));
         org.dom4j.Document dom = p.readFrom(org.dom4j.Document.class, org.dom4j.Document.class, 
             new Annotation[] {}, ct, new MetadataMap<String, String>(),
-            new ByteArrayInputStream(xml.getBytes("UTF-8")));
+            new ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8)));
         return dom;
     }
     
@@ -69,7 +70,7 @@ public class DOM4JProviderTest extends Assert {
         p.setProviders(new ProvidersImpl(createMessage(false)));
         org.dom4j.Document dom = p.readFrom(org.dom4j.Document.class, org.dom4j.Document.class, 
                    new Annotation[]{}, MediaType.APPLICATION_JSON_TYPE, new MetadataMap<String, String>(),
-                   new ByteArrayInputStream(xml.getBytes("UTF-8")));
+                   new ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8)));
         String str = dom.asXML();
         // starts with the xml PI
         assertTrue(str.contains("<a><b>2</b></a>"));

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/hbase/HBaseQueryVisitor.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/hbase/HBaseQueryVisitor.java b/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/hbase/HBaseQueryVisitor.java
index 8d466e4..453d609 100644
--- a/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/hbase/HBaseQueryVisitor.java
+++ b/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/hbase/HBaseQueryVisitor.java
@@ -18,7 +18,7 @@
  */
 package org.apache.cxf.jaxrs.ext.search.hbase;
 
-import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -118,10 +118,10 @@ public class HBaseQueryVisitor<T> extends AbstractSearchConditionVisitor<T, Filt
         String theFamily = family != null ? family : familyMap.get(qualifier);
         ByteArrayComparable byteArrayComparable = regexCompRequired 
             ? new RegexStringComparator(value.toString().replace("*", "."))
-            : new BinaryComparator(getBytes(value.toString()));
+            : new BinaryComparator(value.toString().getBytes(StandardCharsets.UTF_8));
         
-        Filter query = new SingleColumnValueFilter(getBytes(theFamily),
-                                                   getBytes(qualifier),
+        Filter query = new SingleColumnValueFilter(theFamily.getBytes(StandardCharsets.UTF_8),
+                                                   qualifier.getBytes(StandardCharsets.UTF_8),
                                                    compareOp,
                                                    byteArrayComparable);
         return query;
@@ -138,11 +138,4 @@ public class HBaseQueryVisitor<T> extends AbstractSearchConditionVisitor<T, Filt
         return list;
     }
     
-    private byte[] getBytes(String value) {
-        try {
-            return value.getBytes("UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            throw new RuntimeException(e);
-        }
-    }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/AbstractJweDecryptingFilter.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/AbstractJweDecryptingFilter.java b/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/AbstractJweDecryptingFilter.java
index 83e3533..d28b1b7 100644
--- a/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/AbstractJweDecryptingFilter.java
+++ b/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/AbstractJweDecryptingFilter.java
@@ -20,6 +20,7 @@ package org.apache.cxf.rs.security.jose.jaxrs;
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
 
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.rs.security.jose.common.JoseUtils;
@@ -33,7 +34,8 @@ public class AbstractJweDecryptingFilter {
     private JweDecryptionProvider decryption;
     private String defaultMediaType;
     protected JweDecryptionOutput decrypt(InputStream is) throws IOException {
-        JweCompactConsumer jwe = new JweCompactConsumer(new String(IOUtils.readBytesFromStream(is), "UTF-8"));
+        JweCompactConsumer jwe = new JweCompactConsumer(new String(IOUtils.readBytesFromStream(is), 
+                                                                   StandardCharsets.UTF_8));
         JweDecryptionProvider theDecryptor = getInitializedDecryptionProvider(jwe.getJweHeaders());
         JweDecryptionOutput out = new JweDecryptionOutput(jwe.getJweHeaders(), jwe.getDecryptedContent(theDecryptor));
         JoseUtils.traceHeaders(out.getHeaders());

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsJsonWriterInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsJsonWriterInterceptor.java b/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsJsonWriterInterceptor.java
index 9522b9b..dc99b7c 100644
--- a/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsJsonWriterInterceptor.java
+++ b/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsJsonWriterInterceptor.java
@@ -20,6 +20,7 @@ package org.apache.cxf.rs.security.jose.jaxrs;
 
 import java.io.IOException;
 import java.io.OutputStream;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -89,7 +90,7 @@ public class JwsJsonWriterInterceptor extends AbstractJwsJsonWriterProvider impl
             CachedOutputStream cos = new CachedOutputStream(); 
             ctx.setOutputStream(cos);
             ctx.proceed();
-            JwsJsonProducer p = new JwsJsonProducer(new String(cos.getBytes(), "UTF-8"));
+            JwsJsonProducer p = new JwsJsonProducer(new String(cos.getBytes(), StandardCharsets.UTF_8));
             for (JwsSignatureProvider signer : sigProviders) {
                 JwsHeaders protectedHeader = prepareProtectedHeader(ctx, signer);
                 p.signWith(signer, protectedHeader, null);    

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java b/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java
index 4657c9e..e4d8aff 100644
--- a/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java
+++ b/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java
@@ -20,6 +20,7 @@ package org.apache.cxf.rs.security.jose.jaxrs;
 
 import java.io.IOException;
 import java.io.OutputStream;
+import java.nio.charset.StandardCharsets;
 
 import javax.annotation.Priority;
 import javax.ws.rs.WebApplicationException;
@@ -75,7 +76,7 @@ public class JwsWriterInterceptor extends AbstractJwsWriterProvider implements W
             CachedOutputStream cos = new CachedOutputStream(); 
             ctx.setOutputStream(cos);
             ctx.proceed();
-            JwsCompactProducer p = new JwsCompactProducer(headers, new String(cos.getBytes(), "UTF-8"));
+            JwsCompactProducer p = new JwsCompactProducer(headers, new String(cos.getBytes(), StandardCharsets.UTF_8));
             setJoseMediaType(ctx);
             writeJws(p, sigProvider, actualOs);
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/JoseUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/JoseUtils.java b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/JoseUtils.java
index 4649517..225540e 100644
--- a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/JoseUtils.java
+++ b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/JoseUtils.java
@@ -20,8 +20,8 @@ package org.apache.cxf.rs.security.jose.common;
 
 import java.io.File;
 import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
 import java.net.URL;
+import java.nio.charset.StandardCharsets;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Properties;
@@ -110,12 +110,7 @@ public final class JoseUtils {
     }
     
     public static String decodeToString(String encoded) {
-        try {
-            return new String(decode(encoded), "UTF-8");
-        } catch (UnsupportedEncodingException ex) {
-            throw new JoseException(ex);
-        }
-        
+        return new String(decode(encoded), StandardCharsets.UTF_8);
     }
     public static byte[] decode(String encoded) {
         return CryptoUtils.decodeSequence(encoded);

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweCompactConsumer.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweCompactConsumer.java b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweCompactConsumer.java
index eb0c2a7..d508e36 100644
--- a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweCompactConsumer.java
+++ b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweCompactConsumer.java
@@ -19,7 +19,7 @@
 
 package org.apache.cxf.rs.security.jose.jwe;
 
-import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 import java.util.logging.Logger;
 
 import org.apache.cxf.common.logging.LogUtils;
@@ -27,7 +27,6 @@ import org.apache.cxf.common.util.Base64Exception;
 import org.apache.cxf.common.util.Base64UrlUtility;
 import org.apache.cxf.jaxrs.json.basic.JsonMapObject;
 import org.apache.cxf.jaxrs.json.basic.JsonMapObjectReaderWriter;
-import org.apache.cxf.rs.security.jose.common.JoseException;
 import org.apache.cxf.rs.security.jose.common.JoseUtils;
 
 
@@ -113,11 +112,7 @@ public class JweCompactConsumer {
         return decryption.decrypt(jweDecryptionInput);
     }
     public String getDecryptedContentText(JweDecryptionProvider decryption) {
-        try {
-            return new String(getDecryptedContent(decryption), "UTF-8");
-        } catch (UnsupportedEncodingException ex) {
-            throw new JoseException(ex);
-        }
+        return new String(getDecryptedContent(decryption), StandardCharsets.UTF_8);
     }
     public boolean validateCriticalHeaders() {
         return JweUtils.validateCriticalHeaders(getJweHeaders());

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweDecryptionOutput.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweDecryptionOutput.java b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweDecryptionOutput.java
index 3432236..bb68424 100644
--- a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweDecryptionOutput.java
+++ b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweDecryptionOutput.java
@@ -18,9 +18,7 @@
  */
 package org.apache.cxf.rs.security.jose.jwe;
 
-import java.io.UnsupportedEncodingException;
-
-import org.apache.cxf.rs.security.jose.common.JoseException;
+import java.nio.charset.StandardCharsets;
 
 public class JweDecryptionOutput {
     private JweHeaders headers;
@@ -36,10 +34,6 @@ public class JweDecryptionOutput {
         return content;
     }
     public String getContentText() {
-        try {
-            return new String(getContent(), "UTF-8");
-        } catch (UnsupportedEncodingException ex) {
-            throw new JoseException(ex);
-        }
+        return new String(getContent(), StandardCharsets.UTF_8);
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumer.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumer.java b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumer.java
index 3535208..4c2a694 100644
--- a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumer.java
+++ b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumer.java
@@ -18,7 +18,7 @@
  */
 package org.apache.cxf.rs.security.jose.jwe;
 
-import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 import java.util.Collections;
 import java.util.LinkedHashMap;
 import java.util.LinkedList;
@@ -29,7 +29,6 @@ import java.util.logging.Logger;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.jaxrs.json.basic.JsonMapObjectReaderWriter;
-import org.apache.cxf.rs.security.jose.common.JoseException;
 import org.apache.cxf.rs.security.jose.common.JoseUtils;
 import org.apache.cxf.rs.security.jose.jwa.KeyAlgorithm;
 
@@ -175,11 +174,7 @@ public class JweJsonConsumer {
         if (aad == null) {
             return null;
         }
-        try {
-            return new String(aad, "UTF-8");
-        } catch (UnsupportedEncodingException ex) {
-            throw new JoseException(ex);
-        }
+        return new String(aad, StandardCharsets.UTF_8);
     }
     public List<JweJsonEncryptionEntry> getRecipients() {
         return recipients;

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJwtCompactConsumer.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJwtCompactConsumer.java b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJwtCompactConsumer.java
index 247f84b..451b464 100644
--- a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJwtCompactConsumer.java
+++ b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJwtCompactConsumer.java
@@ -17,6 +17,7 @@
  * under the License.
  */
 package org.apache.cxf.rs.security.jose.jwe;
+import java.nio.charset.StandardCharsets;
 import java.security.interfaces.RSAPrivateKey;
 
 import javax.crypto.SecretKey;
@@ -59,7 +60,7 @@ public class JweJwtCompactConsumer  {
     }
     private static String toString(byte[] bytes) {
         try {
-            return new String(bytes, "UTF-8");
+            return new String(bytes, StandardCharsets.UTF_8);
         } catch (Exception ex) {
             throw new RuntimeException(ex);
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/PbesHmacAesWrapKeyEncryptionAlgorithm.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/PbesHmacAesWrapKeyEncryptionAlgorithm.java b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/PbesHmacAesWrapKeyEncryptionAlgorithm.java
index 0a17be5..b52b9bd 100644
--- a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/PbesHmacAesWrapKeyEncryptionAlgorithm.java
+++ b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/PbesHmacAesWrapKeyEncryptionAlgorithm.java
@@ -20,7 +20,7 @@ package org.apache.cxf.rs.security.jose.jwe;
 
 import java.nio.ByteBuffer;
 import java.nio.CharBuffer;
-import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.logging.Logger;
@@ -179,7 +179,7 @@ public class PbesHmacAesWrapKeyEncryptionAlgorithm implements KeyEncryptionProvi
         return StringUtils.toBytesUTF8(str);
     }
     static byte[] charsToBytes(char[] chars) {
-        ByteBuffer bb = Charset.forName("UTF-8").encode(CharBuffer.wrap(chars));
+        ByteBuffer bb = StandardCharsets.UTF_8.encode(CharBuffer.wrap(chars));
         byte[] b = new byte[bb.remaining()];
         bb.get(b);
         return b;

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java
index cd609f5..3fca28d 100644
--- a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java
+++ b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java
@@ -22,6 +22,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.math.BigInteger;
 import java.net.URI;
+import java.nio.charset.StandardCharsets;
 import java.security.PrivateKey;
 import java.security.PublicKey;
 import java.security.cert.X509Certificate;
@@ -501,7 +502,7 @@ public final class JwkUtils {
     }
     private static String toString(byte[] bytes) {
         try {
-            return new String(bytes, "UTF-8");
+            return new String(bytes, StandardCharsets.UTF_8);
         } catch (Exception ex) {
             throw new RuntimeException(ex);
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/jose-parent/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java b/rt/rs/security/jose-parent/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
index c93fb0e..0188d8e 100644
--- a/rt/rs/security/jose-parent/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
+++ b/rt/rs/security/jose-parent/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
@@ -18,6 +18,7 @@
  */
 package org.apache.cxf.rs.security.jose.jwe;
 
+import java.nio.charset.StandardCharsets;
 import java.security.Security;
 import java.security.interfaces.ECPrivateKey;
 import java.security.interfaces.ECPublicKey;
@@ -107,7 +108,7 @@ public class JweCompactReaderWriterTest extends Assert {
                                                            CONTENT_ENCRYPTION_KEY_A3, 
                                                            INIT_VECTOR_A3,
                                                            keyEncryption);
-        String jweContent = encryption.encrypt(specPlainText.getBytes("UTF-8"), null);
+        String jweContent = encryption.encrypt(specPlainText.getBytes(StandardCharsets.UTF_8), null);
         assertEquals(JWE_OUTPUT_A3, jweContent);
         
         AesWrapKeyDecryptionAlgorithm keyDecryption = new AesWrapKeyDecryptionAlgorithm(cekEncryptionKey);
@@ -152,7 +153,7 @@ public class JweCompactReaderWriterTest extends Assert {
                                                            CONTENT_ENCRYPTION_KEY_A3, 
                                                            INIT_VECTOR_A3,
                                                            keyEncryption);
-        String jweContent = encryption.encrypt(specPlainText.getBytes("UTF-8"), null);
+        String jweContent = encryption.encrypt(specPlainText.getBytes(StandardCharsets.UTF_8), null);
         
         RSAPrivateKey privateKey = CryptoUtils.getRSAPrivateKey(RSA_MODULUS_ENCODED_A1, 
                                                                 RSA_PRIVATE_EXPONENT_ENCODED_A1);
@@ -180,7 +181,7 @@ public class JweCompactReaderWriterTest extends Assert {
                                                            CONTENT_ENCRYPTION_KEY_A3, 
                                                            INIT_VECTOR_A3,
                                                            keyEncryption);
-        String jweContent = encryption.encrypt(specPlainText.getBytes("UTF-8"), null);
+        String jweContent = encryption.encrypt(specPlainText.getBytes(StandardCharsets.UTF_8), null);
         
         AesGcmWrapKeyDecryptionAlgorithm keyDecryption = new AesGcmWrapKeyDecryptionAlgorithm(cekEncryptionKey);
         JweDecryptionProvider decryption = new AesCbcHmacJweDecryption(keyDecryption);
@@ -228,12 +229,12 @@ public class JweCompactReaderWriterTest extends Assert {
             new AesGcmContentEncryptionAlgorithm(key == null ? null : key.getEncoded(), INIT_VECTOR_A1, 
                 ContentAlgorithm.getAlgorithm(jwtKeyName));
         JweEncryptionProvider encryptor = new JweEncryption(keyEncryptionAlgo, contentEncryptionAlgo);
-        return encryptor.encrypt(content.getBytes("UTF-8"), null);
+        return encryptor.encrypt(content.getBytes(StandardCharsets.UTF_8), null);
     }
     private String encryptContentDirect(SecretKey key, String content) throws Exception {
         JweEncryption encryptor = new JweEncryption(new DirectKeyEncryptionAlgorithm(),
             new AesGcmContentEncryptionAlgorithm(key, INIT_VECTOR_A1, ContentAlgorithm.A128GCM));
-        return encryptor.encrypt(content.getBytes("UTF-8"), null);
+        return encryptor.encrypt(content.getBytes(StandardCharsets.UTF_8), null);
     }
     private void decrypt(String jweContent, String plainContent, boolean unwrap) throws Exception {
         RSAPrivateKey privateKey = CryptoUtils.getRSAPrivateKey(RSA_MODULUS_ENCODED_A1, 

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/jose-parent/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JwePbeHmacAesWrapTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JwePbeHmacAesWrapTest.java b/rt/rs/security/jose-parent/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JwePbeHmacAesWrapTest.java
index 8898bf0..ab00e97 100644
--- a/rt/rs/security/jose-parent/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JwePbeHmacAesWrapTest.java
+++ b/rt/rs/security/jose-parent/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JwePbeHmacAesWrapTest.java
@@ -18,6 +18,7 @@
  */
 package org.apache.cxf.rs.security.jose.jwe;
 
+import java.nio.charset.StandardCharsets;
 import java.security.Security;
 
 import org.apache.cxf.rs.security.jose.jwa.ContentAlgorithm;
@@ -46,7 +47,7 @@ public class JwePbeHmacAesWrapTest extends Assert {
             new PbesHmacAesWrapKeyEncryptionAlgorithm(password, KeyAlgorithm.PBES2_HS256_A128KW);
         JweEncryptionProvider encryption = new AesCbcHmacJweEncryption(ContentAlgorithm.A128CBC_HS256,
                                                                        keyEncryption);
-        String jweContent = encryption.encrypt(specPlainText.getBytes("UTF-8"), null);
+        String jweContent = encryption.encrypt(specPlainText.getBytes(StandardCharsets.UTF_8), null);
         
         PbesHmacAesWrapKeyDecryptionAlgorithm keyDecryption = new PbesHmacAesWrapKeyDecryptionAlgorithm(password);
         JweDecryptionProvider decryption = new AesCbcHmacJweDecryption(keyDecryption);
@@ -65,7 +66,7 @@ public class JwePbeHmacAesWrapTest extends Assert {
             new PbesHmacAesWrapKeyEncryptionAlgorithm(password, KeyAlgorithm.PBES2_HS256_A128KW);
         JweEncryptionProvider encryption = new JweEncryption(keyEncryption,
             new AesGcmContentEncryptionAlgorithm(ContentAlgorithm.A128GCM));
-        String jweContent = encryption.encrypt(specPlainText.getBytes("UTF-8"), null);
+        String jweContent = encryption.encrypt(specPlainText.getBytes(StandardCharsets.UTF_8), null);
         PbesHmacAesWrapKeyDecryptionAlgorithm keyDecryption = new PbesHmacAesWrapKeyDecryptionAlgorithm(password);
         JweDecryptionProvider decryption = new JweDecryption(keyDecryption, 
                                                new AesGcmContentDecryptionAlgorithm(ContentAlgorithm.A128GCM));

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/utils/OAuthUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/utils/OAuthUtils.java b/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/utils/OAuthUtils.java
index 708144e..aa8f820 100644
--- a/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/utils/OAuthUtils.java
+++ b/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/utils/OAuthUtils.java
@@ -20,6 +20,7 @@ package org.apache.cxf.rs.security.oauth.utils;
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -130,7 +131,7 @@ public final class OAuthUtils {
                                              OAuthMessage oAuthMessage) throws IOException {
         List<Entry<String, String>> params = oAuthMessage.getParameters();
         String enc = oAuthMessage.getBodyEncoding();
-        enc = enc == null ? "UTF-8" : enc;
+        enc = enc == null ? StandardCharsets.UTF_8.name() : enc;
         
         if (params.isEmpty() 
             && MediaType.APPLICATION_FORM_URLENCODED_TYPE.isCompatible(

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/oauth-parent/oauth2-saml/src/main/java/org/apache/cxf/rs/security/oauth2/grants/saml/Saml2BearerGrantHandler.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2-saml/src/main/java/org/apache/cxf/rs/security/oauth2/grants/saml/Saml2BearerGrantHandler.java b/rt/rs/security/oauth-parent/oauth2-saml/src/main/java/org/apache/cxf/rs/security/oauth2/grants/saml/Saml2BearerGrantHandler.java
index f8597c4..71b876a 100644
--- a/rt/rs/security/oauth-parent/oauth2-saml/src/main/java/org/apache/cxf/rs/security/oauth2/grants/saml/Saml2BearerGrantHandler.java
+++ b/rt/rs/security/oauth-parent/oauth2-saml/src/main/java/org/apache/cxf/rs/security/oauth2/grants/saml/Saml2BearerGrantHandler.java
@@ -22,6 +22,7 @@ import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
 import java.security.Principal;
 import java.security.cert.Certificate;
 import java.util.ArrayList;
@@ -81,7 +82,8 @@ public class Saml2BearerGrantHandler extends AbstractGrantHandler {
         //  AccessTokenService may be configured with the form provider
         // which will not decode by default - so listing both the actual 
         // and encoded grant type value will help
-        ENCODED_SAML2_BEARER_GRANT = HttpUtils.urlEncode(Constants.SAML2_BEARER_GRANT, "UTF-8");
+        ENCODED_SAML2_BEARER_GRANT = HttpUtils.urlEncode(Constants.SAML2_BEARER_GRANT, 
+                                                         StandardCharsets.UTF_8.name());
     }
     private Validator samlValidator = new SamlAssertionValidator();
     private SamlOAuthValidator samlOAuthValidator = new SamlOAuthValidator(); 
@@ -164,7 +166,7 @@ public class Saml2BearerGrantHandler extends AbstractGrantHandler {
     protected Element readToken(InputStream tokenStream) {
         
         try {
-            Document doc = StaxUtils.read(new InputStreamReader(tokenStream, "UTF-8"));
+            Document doc = StaxUtils.read(new InputStreamReader(tokenStream, StandardCharsets.UTF_8));
             return doc.getDocumentElement();
         } catch (Exception ex) {
             throw new OAuthServiceException(OAuthConstants.INVALID_GRANT);

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/ClientCodeRequestFilter.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/ClientCodeRequestFilter.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/ClientCodeRequestFilter.java
index ae9f942..3e312a3 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/ClientCodeRequestFilter.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/ClientCodeRequestFilter.java
@@ -20,6 +20,7 @@ package org.apache.cxf.rs.security.oauth2.client;
 
 import java.io.IOException;
 import java.net.URI;
+import java.nio.charset.StandardCharsets;
 import java.util.List;
 
 import javax.annotation.Priority;
@@ -213,9 +214,9 @@ public class ClientCodeRequestFilter implements ContainerRequestFilter {
         MultivaluedMap<String, String> requestState = new MetadataMap<String, String>();
         requestState.putAll(ui.getQueryParameters(decodeRequestParameters));
         if (MediaType.APPLICATION_FORM_URLENCODED_TYPE.isCompatible(rc.getMediaType())) {
-            String body = FormUtils.readBody(rc.getEntityStream(), "UTF-8");
+            String body = FormUtils.readBody(rc.getEntityStream(), StandardCharsets.UTF_8.name());
             FormUtils.populateMapFromString(requestState, JAXRSUtils.getCurrentMessage(), body, 
-                                            "UTF-8", decodeRequestParameters);
+                                            StandardCharsets.UTF_8.name(), decodeRequestParameters);
         }
         return requestState;
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
index 4ee712c..971b481 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
@@ -21,6 +21,7 @@ package org.apache.cxf.rs.security.oauth2.client;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
+import java.nio.charset.StandardCharsets;
 import java.util.Collections;
 import java.util.Map;
 
@@ -285,7 +286,7 @@ public final class OAuthClientUtils {
                 sb.append("Basic ");
                 try {
                     String data = consumer.getKey() + ":" + consumer.getSecret();
-                    sb.append(Base64Utility.encode(data.getBytes("UTF-8")));
+                    sb.append(Base64Utility.encode(data.getBytes(StandardCharsets.UTF_8)));
                 } catch (Exception ex) {
                     throw new ProcessingException(ex);
                 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/jwt/JwtBearerGrantHandler.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/jwt/JwtBearerGrantHandler.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/jwt/JwtBearerGrantHandler.java
index 5bef103..674e4f8 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/jwt/JwtBearerGrantHandler.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/jwt/JwtBearerGrantHandler.java
@@ -18,6 +18,7 @@
  */
 package org.apache.cxf.rs.security.oauth2.grants.jwt;
 
+import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 
 import javax.ws.rs.core.MultivaluedMap;
@@ -42,7 +43,7 @@ public class JwtBearerGrantHandler extends AbstractJwtHandler {
         //  AccessTokenService may be configured with the form provider
         // which will not decode by default - so listing both the actual 
         // and encoded grant type value will help
-        ENCODED_JWT_BEARER_GRANT = HttpUtils.urlEncode(Constants.JWT_BEARER_GRANT, "UTF-8");
+        ENCODED_JWT_BEARER_GRANT = HttpUtils.urlEncode(Constants.JWT_BEARER_GRANT, StandardCharsets.UTF_8.name());
     }
     public JwtBearerGrantHandler() {
         super(Arrays.asList(Constants.JWT_BEARER_GRANT, ENCODED_JWT_BEARER_GRANT));

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProvider.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProvider.java
index fba68a9..c850cef 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProvider.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProvider.java
@@ -23,6 +23,7 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
+import java.nio.charset.StandardCharsets;
 import java.util.Collections;
 import java.util.LinkedHashMap;
 import java.util.Map;
@@ -81,7 +82,7 @@ public class OAuthJSONProvider implements MessageBodyWriter<Object>,
         
         sb.append("}");
         String result = sb.toString();
-        os.write(result.getBytes("UTF-8"));
+        os.write(result.getBytes(StandardCharsets.UTF_8));
         os.flush();
     }
 
@@ -110,7 +111,7 @@ public class OAuthJSONProvider implements MessageBodyWriter<Object>,
         }
         sb.append("}");
         String result = sb.toString();
-        os.write(result.getBytes("UTF-8"));
+        os.write(result.getBytes(StandardCharsets.UTF_8));
         os.flush();
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcIdTokenRequestFilter.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcIdTokenRequestFilter.java b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcIdTokenRequestFilter.java
index 0cc0db4..7026c9c 100644
--- a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcIdTokenRequestFilter.java
+++ b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcIdTokenRequestFilter.java
@@ -19,6 +19,7 @@
 package org.apache.cxf.rs.security.oidc.rp;
 
 import java.io.IOException;
+import java.nio.charset.StandardCharsets;
 
 import javax.ws.rs.container.ContainerRequestContext;
 import javax.ws.rs.container.ContainerRequestFilter;
@@ -54,9 +55,9 @@ public class OidcIdTokenRequestFilter implements ContainerRequestFilter {
     private MultivaluedMap<String, String> toFormData(ContainerRequestContext rc) {
         MultivaluedMap<String, String> requestState = new MetadataMap<String, String>();
         if (MediaType.APPLICATION_FORM_URLENCODED_TYPE.isCompatible(rc.getMediaType())) {
-            String body = FormUtils.readBody(rc.getEntityStream(), "UTF-8");
+            String body = FormUtils.readBody(rc.getEntityStream(), StandardCharsets.UTF_8.name());
             FormUtils.populateMapFromString(requestState, JAXRSUtils.getCurrentMessage(), body, 
-                                            "UTF-8", false);
+                                            StandardCharsets.UTF_8.name(), false);
         }
         return requestState;
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcRpAuthenticationFilter.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcRpAuthenticationFilter.java b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcRpAuthenticationFilter.java
index 415e2cc..de4cad0 100644
--- a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcRpAuthenticationFilter.java
+++ b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcRpAuthenticationFilter.java
@@ -19,6 +19,7 @@
 package org.apache.cxf.rs.security.oidc.rp;
 
 import java.net.URI;
+import java.nio.charset.StandardCharsets;
 
 import javax.annotation.Priority;
 import javax.ws.rs.Priorities;
@@ -85,9 +86,9 @@ public class OidcRpAuthenticationFilter implements ContainerRequestFilter {
         MultivaluedMap<String, String> requestState = new MetadataMap<String, String>();
         requestState.putAll(rc.getUriInfo().getQueryParameters(true));
         if (MediaType.APPLICATION_FORM_URLENCODED_TYPE.isCompatible(rc.getMediaType())) {
-            String body = FormUtils.readBody(rc.getEntityStream(), "UTF-8");
+            String body = FormUtils.readBody(rc.getEntityStream(), StandardCharsets.UTF_8.name());
             FormUtils.populateMapFromString(requestState, JAXRSUtils.getCurrentMessage(), body, 
-                                            "UTF-8", true);
+                                            StandardCharsets.UTF_8.name(), true);
         }
         return requestState;
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractRequestAssertionConsumerHandler.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractRequestAssertionConsumerHandler.java b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractRequestAssertionConsumerHandler.java
index 4d9638b..2de61ae 100644
--- a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractRequestAssertionConsumerHandler.java
+++ b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractRequestAssertionConsumerHandler.java
@@ -22,8 +22,8 @@ import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
 import java.net.URI;
+import java.nio.charset.StandardCharsets;
 import java.util.Date;
 import java.util.ResourceBundle;
 import java.util.UUID;
@@ -235,7 +235,7 @@ public abstract class AbstractRequestAssertionConsumerHandler extends AbstractSS
         // URL Decoding only applies for the re-direct binding
         if (!postBinding) {
             try {
-                samlResponseDecoded = URLDecoder.decode(samlResponse, "UTF-8");
+                samlResponseDecoded = URLDecoder.decode(samlResponse, StandardCharsets.UTF_8);
             } catch (UnsupportedEncodingException e) {
                 throw ExceptionUtils.toBadRequestException(null, null);
             }
@@ -254,16 +254,12 @@ public abstract class AbstractRequestAssertionConsumerHandler extends AbstractSS
                 throw ExceptionUtils.toBadRequestException(ex, null);
             }
         } else {
-            try {
-                tokenStream = new ByteArrayInputStream(samlResponseDecoded.getBytes("UTF-8"));
-            } catch (UnsupportedEncodingException ex) {
-                throw ExceptionUtils.toBadRequestException(ex, null);
-            }
+            tokenStream = new ByteArrayInputStream(samlResponseDecoded.getBytes(StandardCharsets.UTF_8));
         }
         
         Document responseDoc = null;
         try {
-            responseDoc = StaxUtils.read(new InputStreamReader(tokenStream, "UTF-8"));
+            responseDoc = StaxUtils.read(new InputStreamReader(tokenStream, StandardCharsets.UTF_8));
         } catch (Exception ex) {
             throw new WebApplicationException(400);
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractServiceProviderFilter.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractServiceProviderFilter.java b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractServiceProviderFilter.java
index fe9ef86..3d88dc8 100644
--- a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractServiceProviderFilter.java
+++ b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractServiceProviderFilter.java
@@ -22,6 +22,7 @@ import java.io.IOException;
 import java.io.StringReader;
 import java.net.URI;
 import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
 import java.security.Principal;
 import java.util.Map;
 import java.util.ResourceBundle;
@@ -260,7 +261,7 @@ public abstract class AbstractServiceProviderFilter extends AbstractSSOSpHandler
                                                      getWebAppDomain(),
                                                      System.currentTimeMillis());
         
-        String relayState = URLEncoder.encode(UUID.randomUUID().toString(), "UTF-8");
+        String relayState = URLEncoder.encode(UUID.randomUUID().toString(), StandardCharsets.UTF_8.name());
         getStateProvider().setRequestState(relayState, requestState);
         info.setRelayState(relayState);
         info.setWebAppContext(webAppContext);

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/MetadataWriter.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/MetadataWriter.java b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/MetadataWriter.java
index 8363199..d85b9e5 100644
--- a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/MetadataWriter.java
+++ b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/MetadataWriter.java
@@ -20,6 +20,7 @@
 package org.apache.cxf.rs.security.saml.sso;
 
 import java.net.MalformedURLException;
+import java.nio.charset.StandardCharsets;
 import java.security.Key;
 import java.security.cert.CertificateEncodingException;
 import java.security.cert.X509Certificate;
@@ -71,7 +72,7 @@ public class MetadataWriter {
 
         W3CDOMStreamWriter writer = new W3CDOMStreamWriter();
 
-        writer.writeStartDocument("UTF-8", "1.0");
+        writer.writeStartDocument(StandardCharsets.UTF_8.name(), "1.0");
 
         String referenceID = IDGenerator.generateID("_");
         writer.writeStartElement("md", "EntityDescriptor", SSOConstants.SAML2_METADATA_NS);

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLProtocolResponseValidator.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLProtocolResponseValidator.java b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLProtocolResponseValidator.java
index abc949a..d085a6e 100644
--- a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLProtocolResponseValidator.java
+++ b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLProtocolResponseValidator.java
@@ -20,6 +20,7 @@ package org.apache.cxf.rs.security.saml.sso;
 
 import java.io.ByteArrayInputStream;
 import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
 import java.security.PrivateKey;
 import java.security.cert.X509Certificate;
 import java.util.logging.Level;
@@ -481,7 +482,7 @@ public class SAMLProtocolResponseValidator {
         Document payloadDoc = null;
         try {
             payloadDoc = StaxUtils.read(new InputStreamReader(new ByteArrayInputStream(decryptedPayload),
-                                               "UTF-8"));
+                                               StandardCharsets.UTF_8));
             return payloadDoc.getDocumentElement();
         } catch (Exception ex) {
             LOG.log(Level.FINE, "Payload document can not be created", ex);

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlPostBindingFilter.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlPostBindingFilter.java b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlPostBindingFilter.java
index 3f2f09f..9f2fe74 100644
--- a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlPostBindingFilter.java
+++ b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlPostBindingFilter.java
@@ -19,6 +19,7 @@
 package org.apache.cxf.rs.security.saml.sso;
 
 import java.io.IOException;
+import java.nio.charset.StandardCharsets;
 import java.security.PrivateKey;
 import java.security.cert.X509Certificate;
 
@@ -95,9 +96,9 @@ public class SamlPostBindingFilter extends AbstractServiceProviderFilter {
         // Not correct according to the spec but required by some IDPs.
         if (useDeflateEncoding) {
             DeflateEncoderDecoder encoder = new DeflateEncoderDecoder();
-            deflatedBytes = encoder.deflateToken(requestMessage.getBytes("UTF-8"));
+            deflatedBytes = encoder.deflateToken(requestMessage.getBytes(StandardCharsets.UTF_8));
         } else {
-            deflatedBytes = requestMessage.getBytes("UTF-8");
+            deflatedBytes = requestMessage.getBytes(StandardCharsets.UTF_8);
         }
 
         return Base64Utility.encode(deflatedBytes);

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlRedirectBindingFilter.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlRedirectBindingFilter.java b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlRedirectBindingFilter.java
index 1b0ed7a..ebfc7b8 100644
--- a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlRedirectBindingFilter.java
+++ b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlRedirectBindingFilter.java
@@ -20,6 +20,7 @@ package org.apache.cxf.rs.security.saml.sso;
 
 import java.io.IOException;
 import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
 import java.security.PrivateKey;
 import java.security.Signature;
 import java.security.cert.X509Certificate;
@@ -54,7 +55,7 @@ public class SamlRedirectBindingFilter extends AbstractServiceProviderFilter {
             try {
                 SamlRequestInfo info = createSamlRequestInfo(m);
                 String urlEncodedRequest = 
-                    URLEncoder.encode(info.getSamlRequest(), "UTF-8");
+                    URLEncoder.encode(info.getSamlRequest(), StandardCharsets.UTF_8.name());
                 
                 UriBuilder ub = UriBuilder.fromUri(getIdpServiceAddress());
                 
@@ -89,7 +90,7 @@ public class SamlRedirectBindingFilter extends AbstractServiceProviderFilter {
         String requestMessage = DOM2Writer.nodeToString(authnRequest);
 
         DeflateEncoderDecoder encoder = new DeflateEncoderDecoder();
-        byte[] deflatedBytes = encoder.deflateToken(requestMessage.getBytes("UTF-8"));
+        byte[] deflatedBytes = encoder.deflateToken(requestMessage.getBytes(StandardCharsets.UTF_8));
 
         return Base64Utility.encode(deflatedBytes);
     }
@@ -136,7 +137,7 @@ public class SamlRedirectBindingFilter extends AbstractServiceProviderFilter {
             jceSigAlgo = "SHA1withDSA";
         }
         LOG.fine("Using Signature algorithm " + sigAlgo);
-        ub.queryParam(SSOConstants.SIG_ALG, URLEncoder.encode(sigAlgo, "UTF-8"));
+        ub.queryParam(SSOConstants.SIG_ALG, URLEncoder.encode(sigAlgo, StandardCharsets.UTF_8.name()));
         
         // Get the password
         WSPasswordCallback[] cb = {new WSPasswordCallback(signatureUser, WSPasswordCallback.SIGNATURE)};
@@ -153,14 +154,14 @@ public class SamlRedirectBindingFilter extends AbstractServiceProviderFilter {
         String requestToSign = 
             SSOConstants.SAML_REQUEST + "=" + authnRequest + "&"
             + SSOConstants.RELAY_STATE + "=" + relayState + "&"
-            + SSOConstants.SIG_ALG + "=" + URLEncoder.encode(sigAlgo, "UTF-8");
+            + SSOConstants.SIG_ALG + "=" + URLEncoder.encode(sigAlgo, StandardCharsets.UTF_8.name());
 
-        signature.update(requestToSign.getBytes("UTF-8"));
+        signature.update(requestToSign.getBytes(StandardCharsets.UTF_8));
         byte[] signBytes = signature.sign();
         
         String encodedSignature = Base64.encode(signBytes);
         
-        ub.queryParam(SSOConstants.SIGNATURE, URLEncoder.encode(encodedSignature, "UTF-8"));
+        ub.queryParam(SSOConstants.SIGNATURE, URLEncoder.encode(encodedSignature, StandardCharsets.UTF_8.name()));
         
     }
     

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlInHandler.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlInHandler.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlInHandler.java
index a124d7f..c9f0cbf 100644
--- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlInHandler.java
+++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlInHandler.java
@@ -22,6 +22,7 @@ package org.apache.cxf.rs.security.saml;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
 import java.security.PublicKey;
 import java.security.cert.Certificate;
 import java.security.cert.X509Certificate;
@@ -101,7 +102,7 @@ public abstract class AbstractSamlInHandler implements ContainerRequestFilter {
     protected Element readToken(Message message, InputStream tokenStream) {
         
         try {
-            Document doc = StaxUtils.read(new InputStreamReader(tokenStream, "UTF-8"));
+            Document doc = StaxUtils.read(new InputStreamReader(tokenStream, StandardCharsets.UTF_8));
             return doc.getDocumentElement();
         } catch (Exception ex) {
             throwFault("Assertion can not be read as XML document", ex);

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlOutInterceptor.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlOutInterceptor.java
index 04a1032..6632086 100644
--- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlOutInterceptor.java
+++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlOutInterceptor.java
@@ -19,7 +19,7 @@
 package org.apache.cxf.rs.security.saml;
 
 import java.io.StringWriter;
-import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 
 import org.apache.cxf.common.util.Base64Exception;
 import org.apache.cxf.common.util.Base64Utility;
@@ -51,12 +51,8 @@ public abstract class AbstractSamlOutInterceptor extends AbstractPhaseIntercepto
     }
     
     protected String encodeToken(String assertion) throws Base64Exception {
-        byte[] tokenBytes = null;
-        try {
-            tokenBytes = assertion.getBytes("UTF-8");
-        } catch (UnsupportedEncodingException ex) {
-            // won't happen
-        }
+        byte[] tokenBytes = assertion.getBytes(StandardCharsets.UTF_8);
+
         if (useDeflateEncoding) {
             tokenBytes = new DeflateEncoderDecoder().deflateToken(tokenBytes);
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/SamlEnvelopedInHandler.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/SamlEnvelopedInHandler.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/SamlEnvelopedInHandler.java
index 01ef19f..ee10d35 100644
--- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/SamlEnvelopedInHandler.java
+++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/SamlEnvelopedInHandler.java
@@ -21,6 +21,7 @@ package org.apache.cxf.rs.security.saml;
 
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
 
 import javax.ws.rs.HttpMethod;
 import javax.ws.rs.container.ContainerRequestContext;
@@ -58,7 +59,7 @@ public class SamlEnvelopedInHandler extends AbstractSamlInHandler {
         InputStream is = message.getContent(InputStream.class);
         if (is != null) {
             try {
-                doc = StaxUtils.read(new InputStreamReader(is, "UTF-8"));
+                doc = StaxUtils.read(new InputStreamReader(is, StandardCharsets.UTF_8));
             } catch (Exception ex) {
                 throwFault("Invalid XML payload", ex);
             }

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlEncInHandler.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlEncInHandler.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlEncInHandler.java
index 680e46d..5cd7603 100644
--- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlEncInHandler.java
+++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlEncInHandler.java
@@ -22,6 +22,7 @@ package org.apache.cxf.rs.security.xml;
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
 import java.security.PrivateKey;
 import java.security.cert.X509Certificate;
 
@@ -82,7 +83,7 @@ public abstract class AbstractXmlEncInHandler extends AbstractXmlSecInHandler {
         Document payloadDoc = null;
         try {
             payloadDoc = StaxUtils.read(new InputStreamReader(new ByteArrayInputStream(decryptedPayload),
-                                               "UTF-8"));
+                                               StandardCharsets.UTF_8));
         } catch (Exception ex) {
             throwFault("Payload document can not be created", ex);
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java
index f65368e..8d79b1c 100644
--- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java
+++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java
@@ -21,6 +21,7 @@ package org.apache.cxf.rs.security.xml;
 
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
 import java.util.logging.Logger;
 
 import javax.ws.rs.core.Response;
@@ -78,7 +79,7 @@ public abstract class AbstractXmlSecInHandler {
         InputStream is = message.getContent(InputStream.class);
         if (is != null) {
             try {
-                doc = StaxUtils.read(new InputStreamReader(is, "UTF-8"));
+                doc = StaxUtils.read(new InputStreamReader(is, StandardCharsets.UTF_8));
             } catch (Exception ex) {
                 throwFault("Invalid XML payload", ex);
             }

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecOutInterceptor.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecOutInterceptor.java
index bec7fce..7b7d982 100644
--- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecOutInterceptor.java
+++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecOutInterceptor.java
@@ -19,6 +19,7 @@
 package org.apache.cxf.rs.security.xml;
 
 import java.io.OutputStream;
+import java.nio.charset.StandardCharsets;
 import java.security.PrivateKey;
 import java.security.cert.X509Certificate;
 import java.util.ArrayList;
@@ -418,7 +419,7 @@ public class XmlSecOutInterceptor extends AbstractPhaseInterceptor<Message> {
         }
 
         if (encoding == null) {
-            encoding = "UTF-8";
+            encoding = StandardCharsets.UTF_8.name();
             message.put(Message.ENCODING, encoding);
         }
         return encoding;

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/CryptoUtils.java
----------------------------------------------------------------------
diff --git a/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/CryptoUtils.java b/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/CryptoUtils.java
index 0c80fb4..df3b19c 100644
--- a/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/CryptoUtils.java
+++ b/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/CryptoUtils.java
@@ -22,6 +22,7 @@ package org.apache.cxf.rt.security.crypto;
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 import java.math.BigInteger;
+import java.nio.charset.StandardCharsets;
 import java.security.Key;
 import java.security.KeyFactory;
 import java.security.KeyPair;
@@ -409,7 +410,7 @@ public final class CryptoUtils {
         byte[] encryptedBytes = decodeSequence(encodedData);
         byte[] bytes = decryptBytes(encryptedBytes, secretKey, props);
         try {
-            return new String(bytes, "UTF-8");
+            return new String(bytes, StandardCharsets.UTF_8);
         } catch (Exception ex) {
             throw new SecurityException(ex);
         }
@@ -422,7 +423,7 @@ public final class CryptoUtils {
     public static String encryptSequence(String sequence, Key secretKey,
         KeyProperties keyProps) throws SecurityException {
         try {
-            byte[] bytes = encryptBytes(sequence.getBytes("UTF-8"), secretKey, keyProps);
+            byte[] bytes = encryptBytes(sequence.getBytes(StandardCharsets.UTF_8), secretKey, keyProps);
             return encodeBytes(bytes);
         } catch (Exception ex) {
             throw new SecurityException(ex);

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/HmacUtils.java
----------------------------------------------------------------------
diff --git a/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/HmacUtils.java b/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/HmacUtils.java
index bf50224..c40fe85 100644
--- a/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/HmacUtils.java
+++ b/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/HmacUtils.java
@@ -18,7 +18,7 @@
  */
 package org.apache.cxf.rt.security.crypto;
 
-import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.InvalidKeyException;
 import java.security.Key;
@@ -86,11 +86,7 @@ public final class HmacUtils {
     }
     
     public static byte[] computeHmac(String key, Mac hmac, String data) {
-        try {
-            return computeHmac(key.getBytes("UTF-8"), hmac, data);
-        } catch (UnsupportedEncodingException e) {
-            throw new SecurityException(e);
-        }
+        return computeHmac(key.getBytes(StandardCharsets.UTF_8), hmac, data);
     }
     
     public static byte[] computeHmac(byte[] key, Mac hmac, String data) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/MessageDigestUtils.java
----------------------------------------------------------------------
diff --git a/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/MessageDigestUtils.java b/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/MessageDigestUtils.java
index 1c18df2..28b8597 100644
--- a/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/MessageDigestUtils.java
+++ b/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/MessageDigestUtils.java
@@ -18,7 +18,7 @@
  */
 package org.apache.cxf.rt.security.crypto;
 
-import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 
@@ -53,9 +53,7 @@ public final class MessageDigestUtils {
 
     public static byte[] createDigest(String input, String algo) {
         try {
-            return createDigest(input.getBytes("UTF-8"), algo);
-        } catch (UnsupportedEncodingException e) {
-            throw new SecurityException(e);
+            return createDigest(input.getBytes(StandardCharsets.UTF_8), algo);
         } catch (NoSuchAlgorithmException e) {
             throw new SecurityException(e);
         }   

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java b/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java
index 4692c3a..e10fb2a 100644
--- a/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java
+++ b/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java
@@ -22,6 +22,7 @@ package org.apache.cxf.transport.http_jetty;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.net.URL;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -659,7 +660,7 @@ public class JettyHTTPDestinationTest extends Assert {
                 EasyMock.expect(request.getRequestURI()).andReturn("/foo");
                 EasyMock.expect(request.getRequestURL())
                     .andReturn(new StringBuffer("http://localhost/foo")).anyTimes();
-                EasyMock.expect(request.getCharacterEncoding()).andReturn("UTF-8");
+                EasyMock.expect(request.getCharacterEncoding()).andReturn(StandardCharsets.UTF_8.name());
                 EasyMock.expect(request.getQueryString()).andReturn(query);    
                 EasyMock.expect(request.getHeader("Accept")).andReturn("*/*");  
                 EasyMock.expect(request.getContentType()).andReturn("text/xml charset=utf8").times(2);
@@ -754,7 +755,7 @@ public class JettyHTTPDestinationTest extends Assert {
         request.getPathInfo();
         EasyMock.expectLastCall().andReturn("/bar/foo");
         request.getCharacterEncoding();
-        EasyMock.expectLastCall().andReturn("UTF-8");
+        EasyMock.expectLastCall().andReturn(StandardCharsets.UTF_8.name());
         request.getQueryString();
         EasyMock.expectLastCall().andReturn("wsdl");    
         response.setContentType("text/xml");

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/util/Utils.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/util/Utils.java b/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/util/Utils.java
index a8db207..d3800a3 100644
--- a/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/util/Utils.java
+++ b/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/util/Utils.java
@@ -24,6 +24,7 @@ import java.io.UnsupportedEncodingException;
 import java.net.FileNameMap;
 import java.net.URLConnection;
 import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -144,10 +145,10 @@ public final class Utils {
     public static String sanitizeUri(String uri) {
         // Decode the path.
         try {
-            uri = URLDecoder.decode(uri, "UTF-8");
+            uri = URLDecoder.decode(uri, StandardCharsets.UTF_8.name());
         } catch (UnsupportedEncodingException e) {
             try {
-                uri = URLDecoder.decode(uri, "ISO-8859-1");
+                uri = URLDecoder.decode(uri, StandardCharsets.ISO_8859_1.name());
             } catch (UnsupportedEncodingException e1) {
                 throw new Error();
             }

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/NettyHttpDestinationTest.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/NettyHttpDestinationTest.java b/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/NettyHttpDestinationTest.java
index 2882b5d..f08bd2a 100644
--- a/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/NettyHttpDestinationTest.java
+++ b/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/NettyHttpDestinationTest.java
@@ -22,6 +22,7 @@ package org.apache.cxf.transport.http.netty.server;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.net.URL;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -656,7 +657,7 @@ public class NettyHttpDestinationTest extends Assert {
                 EasyMock.expect(request.getRequestURI()).andReturn("/foo");
                 EasyMock.expect(request.getRequestURL())
                     .andReturn(new StringBuffer("http://localhost/foo")).anyTimes();
-                EasyMock.expect(request.getCharacterEncoding()).andReturn("UTF-8");
+                EasyMock.expect(request.getCharacterEncoding()).andReturn(StandardCharsets.UTF_8.name());
                 EasyMock.expect(request.getQueryString()).andReturn(query).times(2);    
                 EasyMock.expect(request.getHeader("Accept")).andReturn("*/*");  
                 EasyMock.expect(request.getContentType()).andReturn("text/xml charset=utf8").times(2);
@@ -751,7 +752,7 @@ public class NettyHttpDestinationTest extends Assert {
         request.getPathInfo();
         EasyMock.expectLastCall().andReturn("/bar/foo");
         request.getCharacterEncoding();
-        EasyMock.expectLastCall().andReturn("UTF-8");
+        EasyMock.expectLastCall().andReturn(StandardCharsets.UTF_8.name());
         request.getQueryString();
         EasyMock.expectLastCall().andReturn("wsdl");    
         response.setContentType("text/xml");

http://git-wip-us.apache.org/repos/asf/cxf/blob/173ec897/rt/transports/http/src/main/java/org/apache/cxf/transport/https/httpclient/PublicSuffixMatcherLoader.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/https/httpclient/PublicSuffixMatcherLoader.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/https/httpclient/PublicSuffixMatcherLoader.java
index fe48811..1c02bcc 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/https/httpclient/PublicSuffixMatcherLoader.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/https/httpclient/PublicSuffixMatcherLoader.java
@@ -31,6 +31,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.net.URL;
+import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -53,7 +54,7 @@ public final class PublicSuffixMatcherLoader {
 
     private static PublicSuffixMatcher load(final InputStream in) throws IOException {
         final PublicSuffixList list = new PublicSuffixListParser().parse(
-                new InputStreamReader(in, "UTF-8"));
+                new InputStreamReader(in, StandardCharsets.UTF_8));
         return new PublicSuffixMatcher(list.getRules(), list.getExceptions());
     }
 


Mime
View raw message