From e63cd605f3fe8b7d494eafd3f53a019033510ba1 Mon Sep 17 00:00:00 2001 From: Jaroslav Bachorik Date: Fri, 10 Apr 2015 15:26:17 +0200 Subject: [PATCH] 8077407: Even better MBean connections Reviewed-by: sla --- .../MBeanServerInvocationHandler.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/jdk/src/java.management/share/classes/javax/management/MBeanServerInvocationHandler.java b/jdk/src/java.management/share/classes/javax/management/MBeanServerInvocationHandler.java index a5c132caa9b..d667dc7350b 100644 --- a/jdk/src/java.management/share/classes/javax/management/MBeanServerInvocationHandler.java +++ b/jdk/src/java.management/share/classes/javax/management/MBeanServerInvocationHandler.java @@ -141,12 +141,12 @@ public class MBeanServerInvocationHandler implements InvocationHandler { 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 @@ public class MBeanServerInvocationHandler implements InvocationHandler { 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; }