< prev index next >

src/java.base/share/classes/java/net/URLConnection.java

Print this page

        

@@ -1321,11 +1321,13 @@
                     if (cl != null) {
                         cls = cl.loadClass(clsName);
                     }
                 }
                 if (cls != null) {
-                    return (ContentHandler) cls.newInstance();
+                    @SuppressWarnings("deprecation")
+                    Object tmp = cls.newInstance();
+                    return (ContentHandler) tmp;
                 }
             } catch(Exception ignored) { }
         }
 
         return UnknownContentHandler.INSTANCE;
< prev index next >