jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java
Print this page
rev 5687 : 8000539: Introspect JMX data handling
Summary: Added extra packageAccess check call
Reviewed-by: ahgross, dfuchs
Contributed-by: jaroslav.bachorik@oracle.com
*** 54,63 ****
--- 54,65 ----
import java.beans.PropertyDescriptor;
import java.lang.reflect.Array;
import java.lang.reflect.InvocationTargetException;
import javax.management.AttributeNotFoundException;
import javax.management.openmbean.CompositeData;
+ import sun.reflect.misc.MethodUtil;
+ import sun.reflect.misc.ReflectUtil;
/**
* This class contains the methods for performing all the tests needed to verify
* that a class represents a JMX compliant MBean.
*
*** 526,537 ****
} else {
// Java Beans not available so use simple introspection
// to locate method
readMethod = SimpleIntrospector.getReadMethod(clazz, element);
}
! if (readMethod != null)
! return readMethod.invoke(complex);
throw new AttributeNotFoundException(
"Could not find the getter method for the property " +
element + " using the Java Beans introspector");
}
--- 528,541 ----
} else {
// Java Beans not available so use simple introspection
// to locate method
readMethod = SimpleIntrospector.getReadMethod(clazz, element);
}
! if (readMethod != null) {
! ReflectUtil.checkPackageAccess(readMethod.getDeclaringClass());
! return MethodUtil.invoke(readMethod, complex, new Class[0]);
! }
throw new AttributeNotFoundException(
"Could not find the getter method for the property " +
element + " using the Java Beans introspector");
}