Skip to content

Commit adb73d5

Browse files
committed
Remaining polishing
1 parent 7eee7d2 commit adb73d5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

spring-context/src/main/java/org/springframework/jmx/export/MBeanExporter.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -762,22 +762,22 @@ protected boolean isMBean(Class<?> beanClass) {
762762
protected DynamicMBean adaptMBeanIfPossible(Object bean) throws JMException {
763763
Class<?> targetClass = AopUtils.getTargetClass(bean);
764764
if (targetClass != bean.getClass()) {
765-
Class<Object> ifc = (Class<Object>) JmxUtils.getMXBeanInterface(targetClass);
765+
Class<?> ifc = JmxUtils.getMXBeanInterface(targetClass);
766766
if (ifc != null) {
767-
if (!(ifc.isInstance(bean))) {
767+
if (!ifc.isInstance(bean)) {
768768
throw new NotCompliantMBeanException("Managed bean [" + bean +
769769
"] has a target class with an MXBean interface but does not expose it in the proxy");
770770
}
771-
return new StandardMBean(bean, ifc, true);
771+
return new StandardMBean(bean, ((Class<Object>) ifc), true);
772772
}
773773
else {
774-
ifc = (Class<Object>) JmxUtils.getMBeanInterface(targetClass);
774+
ifc = JmxUtils.getMBeanInterface(targetClass);
775775
if (ifc != null) {
776-
if (!(ifc.isInstance(bean))) {
776+
if (!ifc.isInstance(bean)) {
777777
throw new NotCompliantMBeanException("Managed bean [" + bean +
778778
"] has a target class with an MBean interface but does not expose it in the proxy");
779779
}
780-
return new StandardMBean(bean, ifc);
780+
return new StandardMBean(bean, ((Class<Object>) ifc));
781781
}
782782
}
783783
}

0 commit comments

Comments
 (0)