changeset 14361:ddf9b6697e60

8155963: Fix deprecation warning in windows java.net implementation Reviewed-by: prr
author darcy
date Tue, 03 May 2016 12:18:50 -0700
parents 03453120a011
children 1db91f64f71b bd2eb98cc819
files src/java.base/windows/classes/java/net/DefaultDatagramSocketImplFactory.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/windows/classes/java/net/DefaultDatagramSocketImplFactory.java	Tue May 03 10:40:54 2016 -0700
+++ b/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");
             }