7192975: Issue with JMX reflection
authordsamersoff
Mon, 24 Sep 2012 17:00:40 +0400
changeset 14224 45edf328226f
parent 14223 754dc892778f
child 14225 d70ba7fdeae0
7192975: Issue with JMX reflection Summary: Make security check unconditional Reviewed-by: ahgross, asaha Contributed-by: jaroslav.bachorik@oracle.com
jdk/src/share/classes/javax/management/modelmbean/DescriptorSupport.java
--- 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});