changeset 6526:ca79b33a0731

7192975: Issue with JMX reflection Summary: Make security check unconditional Reviewed-by: ahgross, asaha Contributed-by: jaroslav.bachorik@oracle.com
author dsamersoff
date Mon, 24 Sep 2012 17:00:40 +0400
parents e113ffde452a
children 74eec13c464e
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	Mon Sep 24 16:15:27 2012 +0400
+++ b/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});