From adb73d5f35eea28af46533367e00ae6a942fe2e9 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 8 Jul 2014 00:21:17 +0200 Subject: [PATCH] Remaining polishing --- .../springframework/jmx/export/MBeanExporter.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/jmx/export/MBeanExporter.java b/spring-context/src/main/java/org/springframework/jmx/export/MBeanExporter.java index 12d0a24b52a..e6bec014266 100644 --- a/spring-context/src/main/java/org/springframework/jmx/export/MBeanExporter.java +++ b/spring-context/src/main/java/org/springframework/jmx/export/MBeanExporter.java @@ -762,22 +762,22 @@ public class MBeanExporter extends MBeanRegistrationSupport implements MBeanExpo protected DynamicMBean adaptMBeanIfPossible(Object bean) throws JMException { Class targetClass = AopUtils.getTargetClass(bean); if (targetClass != bean.getClass()) { - Class ifc = (Class) JmxUtils.getMXBeanInterface(targetClass); + Class ifc = JmxUtils.getMXBeanInterface(targetClass); if (ifc != null) { - if (!(ifc.isInstance(bean))) { + if (!ifc.isInstance(bean)) { throw new NotCompliantMBeanException("Managed bean [" + bean + "] has a target class with an MXBean interface but does not expose it in the proxy"); } - return new StandardMBean(bean, ifc, true); + return new StandardMBean(bean, ((Class) ifc), true); } else { - ifc = (Class) JmxUtils.getMBeanInterface(targetClass); + ifc = JmxUtils.getMBeanInterface(targetClass); if (ifc != null) { - if (!(ifc.isInstance(bean))) { + if (!ifc.isInstance(bean)) { throw new NotCompliantMBeanException("Managed bean [" + bean + "] has a target class with an MBean interface but does not expose it in the proxy"); } - return new StandardMBean(bean, ifc); + return new StandardMBean(bean, ((Class) ifc)); } } }