changeset 12396:7ab49912a799

8077407: Even better MBean connections Reviewed-by: sla
author jbachorik
date Fri, 10 Apr 2015 15:26:17 +0200
parents ae7ff07e54a8
children 74b74287dbde
files src/java.management/share/classes/javax/management/MBeanServerInvocationHandler.java
diffstat 1 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.management/share/classes/javax/management/MBeanServerInvocationHandler.java	Wed Apr 01 17:30:28 2015 +0200
+++ b/src/java.management/share/classes/javax/management/MBeanServerInvocationHandler.java	Fri Apr 10 15:26:17 2015 +0200
@@ -141,12 +141,12 @@
         if (connection == null) {
             throw new IllegalArgumentException("Null connection");
         }
-//        if (Proxy.isProxyClass(connection.getClass())) {
-//            if (MBeanServerInvocationHandler.class.isAssignableFrom(
-//                    Proxy.getInvocationHandler(connection).getClass())) {
-//                throw new IllegalArgumentException("Wrapping MBeanServerInvocationHandler");
-//            }
-//        }
+        if (Proxy.isProxyClass(connection.getClass())) {
+            if (MBeanServerInvocationHandler.class.isAssignableFrom(
+                    Proxy.getInvocationHandler(connection).getClass())) {
+                throw new IllegalArgumentException("Wrapping MBeanServerInvocationHandler");
+            }
+        }
         if (objectName == null) {
             throw new IllegalArgumentException("Null object name");
         }
@@ -424,10 +424,10 @@
                              new Class<?>[] {Object.class})
             && isLocal(proxy, method))
             return true;
-//        if (methodName.equals("finalize")
-//            && method.getParameterTypes().length == 0) {
-//            return true;
-//        }
+        if (methodName.equals("finalize")
+            && method.getParameterTypes().length == 0) {
+            return true;
+        }
         return false;
     }