From 5f8a441f1a19d11ffb96d19b50195cf5717c7dc1 Mon Sep 17 00:00:00 2001 From: Amit Sapre Date: Wed, 31 Aug 2016 12:10:00 +0300 Subject: [PATCH] 8066635: Fix deprecation warnings in java.management module Fixed deprecation warnings in java.management module Reviewed-by: dholmes --- .../DefaultMBeanServerInterceptor.java | 21 +------------- .../interceptor/MBeanServerInterceptor.java | 28 +------------------ .../classes/javax/management/MBeanServer.java | 21 ++++++++------ 3 files changed, 15 insertions(+), 55 deletions(-) diff --git a/jdk/src/java.management/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java b/jdk/src/java.management/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java index a0589f72b05..350eb0218a0 100644 --- a/jdk/src/java.management/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java +++ b/jdk/src/java.management/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java @@ -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 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { 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."); } diff --git a/jdk/src/java.management/share/classes/com/sun/jmx/interceptor/MBeanServerInterceptor.java b/jdk/src/java.management/share/classes/com/sun/jmx/interceptor/MBeanServerInterceptor.java index 8f0f9b66a5a..bbb1340d141 100644 --- a/jdk/src/java.management/share/classes/com/sun/jmx/interceptor/MBeanServerInterceptor.java +++ b/jdk/src/java.management/share/classes/com/sun/jmx/interceptor/MBeanServerInterceptor.java @@ -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 @@ -94,32 +94,6 @@ public interface MBeanServerInterceptor extends MBeanServer { throws ReflectionException, MBeanException, InstanceNotFoundException; - /** - * 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. diff --git a/jdk/src/java.management/share/classes/javax/management/MBeanServer.java b/jdk/src/java.management/share/classes/javax/management/MBeanServer.java index 1526d818013..b093b204fe3 100644 --- a/jdk/src/java.management/share/classes/javax/management/MBeanServer.java +++ b/jdk/src/java.management/share/classes/javax/management/MBeanServer.java @@ -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 @@ public interface MBeanServer extends MBeanServerConnection { * 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."); + } /** *

De-serializes a byte array in the context of a given MBean @@ -693,8 +694,10 @@ public interface MBeanServer extends MBeanServerConnection { * 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 @@ public interface MBeanServer extends MBeanServerConnection { * 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."); + } /** *

Return the {@link java.lang.ClassLoader} that was used for