7192975: Issue with JMX reflection
Summary: Make security check unconditional
Reviewed-by: ahgross, asaha
Contributed-by: jaroslav.bachorik@oracle.com
--- a/jdk/src/share/classes/javax/management/modelmbean/DescriptorSupport.java Mon Sep 24 16:15:27 2012 +0400
+++ b/jdk/src/share/classes/javax/management/modelmbean/DescriptorSupport.java Mon Sep 24 17:00:40 2012 +0400
@@ -1245,13 +1245,12 @@
return s.substring(1, s.length() - 1);
}
final String className = s.substring(1, slash);
+
final Constructor<?> constr;
try {
+ ReflectUtil.checkPackageAccess(className);
final ClassLoader contextClassLoader =
Thread.currentThread().getContextClassLoader();
- if (contextClassLoader == null) {
- ReflectUtil.checkPackageAccess(className);
- }
final Class<?> c =
Class.forName(className, false, contextClassLoader);
constr = c.getConstructor(new Class<?>[] {String.class});