8087350: Improve array conversions

Reviewed-by: dfuchs, ahgross
This commit is contained in:
Jaroslav Bachorik 2015-06-15 12:58:33 +02:00
parent 9fe659cafa
commit 17ac153c62

View File

@ -761,11 +761,15 @@ public class OpenMBeanAttributeInfoSupport
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
}