8155963: Fix deprecation warning in windows java.net implementation
authordarcy
Tue, 03 May 2016 12:18:50 -0700
changeset 37783 c6aca850d162
parent 37782 ad8fe7507ecc
child 37784 d1c957a6806f
child 38398 74cd426ebb3d
8155963: Fix deprecation warning in windows java.net implementation Reviewed-by: prr
jdk/src/java.base/windows/classes/java/net/DefaultDatagramSocketImplFactory.java
--- a/jdk/src/java.base/windows/classes/java/net/DefaultDatagramSocketImplFactory.java	Tue May 03 10:40:54 2016 -0700
+++ b/jdk/src/java.base/windows/classes/java/net/DefaultDatagramSocketImplFactory.java	Tue May 03 12:18:50 2016 -0700
@@ -90,7 +90,9 @@
         throws SocketException {
         if (prefixImplClass != null) {
             try {
-                return (DatagramSocketImpl) prefixImplClass.newInstance();
+                @SuppressWarnings("deprecation")
+                Object result = prefixImplClass.newInstance();
+                return (DatagramSocketImpl) result;
             } catch (Exception e) {
                 throw new SocketException("can't instantiate DatagramSocketImpl");
             }