diff --git a/src/share/classes/javax/management/modelmbean/DescriptorSupport.java b/src/share/classes/javax/management/modelmbean/DescriptorSupport.java index 57b4b46365e52acb75479c248ef088d15322212d..068047967ea76933598f0e890dd7a1c307a0acce 100644 --- a/src/share/classes/javax/management/modelmbean/DescriptorSupport.java +++ b/src/share/classes/javax/management/modelmbean/DescriptorSupport.java @@ -1245,13 +1245,12 @@ public class DescriptorSupport 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});