changeset 11280:73d8704c8e30

8087350: Improve array conversions Reviewed-by: jbachorik, kevinw
author poonam
date Thu, 30 Jul 2015 07:31:07 -0700
parents b707d58b510a
children 9537ffca1fd3
files src/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java	Wed Jul 29 11:18:37 2015 -0700
+++ b/src/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java	Thu Jul 30 07:31:07 2015 -0700
@@ -761,11 +761,15 @@
         Class<?> stringArrayClass;
         Class<?> targetArrayClass;
         try {
+            String baseClassName = baseType.safeGetClassName();
+
+            // check access to the provided base type class name and bail out early
+            ReflectUtil.checkPackageAccess(baseClassName);
+
             stringArrayClass =
                 Class.forName(squareBrackets + "Ljava.lang.String;");
             targetArrayClass =
-                Class.forName(squareBrackets + "L" + baseType.safeGetClassName() +
-                              ";");
+                Class.forName(squareBrackets + "L" + baseClassName + ";");
         } catch (ClassNotFoundException e) {
             throw new NoClassDefFoundError(e.toString());  // can't happen
         }