jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/PseudoSchemaBuilder.java
changeset 27837 86d4f46e622a
parent 25871 b80b84e87032
--- a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/PseudoSchemaBuilder.java	Wed Jul 05 20:08:43 2017 +0200
+++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/PseudoSchemaBuilder.java	Tue Dec 02 15:03:49 2014 +0100
@@ -41,7 +41,7 @@
 import java.io.ByteArrayInputStream;
 import java.io.StringReader;
 import java.io.StringWriter;
-import java.nio.charset.StandardCharsets;
+import java.io.UnsupportedEncodingException;
 import java.text.MessageFormat;
 import java.util.*;
 
@@ -108,7 +108,7 @@
         }
         //add w3c EPR binding
         if(!(options.noAddressingBbinding) && options.target.isLaterThan(Options.Target.V2_1)){
-            InputSource is = new InputSource(new ByteArrayInputStream(w3ceprSchemaBinding.getBytes(StandardCharsets.UTF_8)));
+            InputSource is = new InputSource(new ByteArrayInputStream(getUTF8Bytes(w3ceprSchemaBinding)));
             is.setSystemId(sysId+(++i +1));
             b.schemas.add(is);
         }
@@ -123,6 +123,15 @@
         return b.schemas;
     }
 
+    private static byte[] getUTF8Bytes(String w3ceprSchemaBinding1) {
+        try {
+            return w3ceprSchemaBinding1.getBytes("UTF-8");
+        } catch (UnsupportedEncodingException unexpected) {
+            // should never happen
+            throw new IllegalStateException(unexpected);
+        }
+    }
+
 
     private PseudoSchemaBuilder(WSDLDocument _wsdl) {
         this.wsdlDocument = _wsdl;