changeset 5466:ffad06d70095 jdk7u9-b05

7192975: Issue with JMX reflection Summary: Make security check unconditional Reviewed-by: ahgross, asaha Contributed-by: jaroslav.bachorik@oracle.com
author dsamersoff
date Sun, 23 Sep 2012 23:43:31 +0400
parents aa9a9ab56adb
children 4e6d5548a253
files src/share/classes/javax/management/modelmbean/DescriptorSupport.java
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/javax/management/modelmbean/DescriptorSupport.java	Thu Sep 20 14:23:18 2012 -0700
+++ b/src/share/classes/javax/management/modelmbean/DescriptorSupport.java	Sun Sep 23 23:43:31 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});