< prev index next >

src/java.xml.bind/share/classes/com/sun/xml/internal/org/jvnet/mimepull/FactoryFinder.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -27,10 +27,11 @@
 
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
 class FactoryFinder {
 

@@ -68,15 +69,11 @@
         }
 
         String factoryClassName;
         BufferedReader rd = null;
         try {
-            try {
-                rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
-            } catch (java.io.UnsupportedEncodingException e) {
-                rd = new BufferedReader(new InputStreamReader(is));
-            }
+            rd = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8));
             try {
                 factoryClassName = rd.readLine();
             } catch (IOException x) {
                 return null;
             }
< prev index next >