< prev index next >

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

Print this page

        

@@ -1643,11 +1643,13 @@
          * property can vary across implementations of the java.
          * classes.  The default is an empty String "".
          */
         String prefix = GetPropertyAction.getProperty("impl.prefix", "");
         try {
-            impl = Class.forName("java.net." + prefix + implName).newInstance();
+            @SuppressWarnings("deprecation")
+            Object tmp = Class.forName("java.net." + prefix + implName).newInstance();
+            impl = tmp;
         } catch (ClassNotFoundException e) {
             System.err.println("Class not found: java.net." + prefix +
                                implName + ":\ncheck impl.prefix property " +
                                "in your properties file.");
         } catch (InstantiationException e) {

@@ -1660,11 +1662,13 @@
                                "in your properties file.");
         }
 
         if (impl == null) {
             try {
-                impl = Class.forName(implName).newInstance();
+                @SuppressWarnings("deprecation")
+                Object tmp = Class.forName(implName).newInstance();
+                impl = tmp;
             } catch (Exception e) {
                 throw new Error("System property impl.prefix incorrect");
             }
         }
 
< prev index next >