changeset 12936:323d428e6f0f

8087350: Improve array conversions Reviewed-by: dfuchs, ahgross
author jbachorik
date Mon, 15 Jun 2015 12:58:33 +0200
parents 2fed1d855201
children aa49cbb03b23
files src/java.management/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.management/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java	Tue Jun 16 14:38:12 2015 -0700
+++ b/src/java.management/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java	Mon Jun 15 12:58:33 2015 +0200
@@ -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
         }