8066635: Fix deprecation warnings in java.management module
authordsamersoff
Wed, 31 Aug 2016 12:10:00 +0300
changeset 40956 4326ea45a1c0
parent 40954 72ca7f63532a
child 40957 bb78c30667b3
8066635: Fix deprecation warnings in java.management module Summary: Fixed deprecation warnings in java.management module Reviewed-by: dholmes Contributed-by: amit.sapre@oracle.com
jdk/src/java.management/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java
jdk/src/java.management/share/classes/com/sun/jmx/interceptor/MBeanServerInterceptor.java
jdk/src/java.management/share/classes/javax/management/MBeanServer.java
--- a/jdk/src/java.management/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java	Tue Aug 30 23:46:02 2016 -0400
+++ b/jdk/src/java.management/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java	Wed Aug 31 12:10:00 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2016, 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
@@ -1707,25 +1707,6 @@
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
-    @SuppressWarnings("deprecation")
-    public ObjectInputStream deserialize(ObjectName name, byte[] data) throws InstanceNotFoundException,
-                                                                              OperationsException {
-        throw new UnsupportedOperationException("Not supported yet.");
-    }
-
-    @SuppressWarnings("deprecation")
-    public ObjectInputStream deserialize(String className, byte[] data) throws OperationsException,
-                                                                               ReflectionException {
-        throw new UnsupportedOperationException("Not supported yet.");
-    }
-
-    @SuppressWarnings("deprecation")
-    public ObjectInputStream deserialize(String className, ObjectName loaderName,
-            byte[] data) throws InstanceNotFoundException, OperationsException,
-                                ReflectionException {
-        throw new UnsupportedOperationException("Not supported yet.");
-    }
-
     public ClassLoaderRepository getClassLoaderRepository() {
         throw new UnsupportedOperationException("Not supported yet.");
     }
--- a/jdk/src/java.management/share/classes/com/sun/jmx/interceptor/MBeanServerInterceptor.java	Tue Aug 30 23:46:02 2016 -0400
+++ b/jdk/src/java.management/share/classes/com/sun/jmx/interceptor/MBeanServerInterceptor.java	Wed Aug 31 12:10:00 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, 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
@@ -98,32 +98,6 @@
      * This method should never be called.
      * Usually throws UnsupportedOperationException.
      */
-    @Deprecated
-    public ObjectInputStream deserialize(ObjectName name, byte[] data)
-            throws InstanceNotFoundException, OperationsException;
-
-    /**
-     * This method should never be called.
-     * Usually throws UnsupportedOperationException.
-     */
-    @Deprecated
-    public ObjectInputStream deserialize(String className, byte[] data)
-            throws OperationsException, ReflectionException;
-
-    /**
-     * This method should never be called.
-     * Usually hrows UnsupportedOperationException.
-     */
-    @Deprecated
-    public ObjectInputStream deserialize(String className,
-            ObjectName loaderName, byte[] data)
-            throws InstanceNotFoundException, OperationsException,
-            ReflectionException;
-
-    /**
-     * This method should never be called.
-     * Usually throws UnsupportedOperationException.
-     */
     public ClassLoaderRepository getClassLoaderRepository();
 
 }
--- a/jdk/src/java.management/share/classes/javax/management/MBeanServer.java	Tue Aug 30 23:46:02 2016 -0400
+++ b/jdk/src/java.management/share/classes/javax/management/MBeanServer.java	Wed Aug 31 12:10:00 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, 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
@@ -666,9 +666,10 @@
      * obtain the appropriate class loader for deserialization.
      */
     @Deprecated
-    public ObjectInputStream deserialize(ObjectName name, byte[] data)
-            throws InstanceNotFoundException, OperationsException;
-
+    default public ObjectInputStream deserialize(ObjectName name, byte[] data)
+            throws InstanceNotFoundException, OperationsException {
+        throw new UnsupportedOperationException("Not supported.");
+    }
 
     /**
      * <p>De-serializes a byte array in the context of a given MBean
@@ -693,8 +694,10 @@
      * class loader repository and use it to deserialize.
      */
     @Deprecated
-    public ObjectInputStream deserialize(String className, byte[] data)
-            throws OperationsException, ReflectionException;
+    default public ObjectInputStream deserialize(String className, byte[] data)
+            throws OperationsException, ReflectionException {
+        throw new UnsupportedOperationException("Not supported.");
+    }
 
 
     /**
@@ -724,11 +727,13 @@
      * the class loader for deserialization.
      */
     @Deprecated
-    public ObjectInputStream deserialize(String className,
+    default public ObjectInputStream deserialize(String className,
                                          ObjectName loaderName,
                                          byte[] data)
             throws InstanceNotFoundException, OperationsException,
-                   ReflectionException;
+                   ReflectionException {
+        throw new UnsupportedOperationException("Not supported.");
+    }
 
     /**
      * <p>Return the {@link java.lang.ClassLoader} that was used for