8267921: Remove redundant loop from sun.reflect.misc.ReflectUtil.privateCheckPackageAccess()

Reviewed-by: alanb, mchung
This commit is contained in:
Sergey Tsypanov 2021-05-31 16:58:38 +00:00 committed by Mandy Chung
parent 382e7eca48
commit c06db45fa7

@ -124,10 +124,6 @@ public final class ReflectUtil {
* NOTE: should only be called if a SecurityManager is installed
*/
private static void privateCheckPackageAccess(SecurityManager s, Class<?> clazz) {
while (clazz.isArray()) {
clazz = clazz.getComponentType();
}
String pkg = clazz.getPackageName();
if (!pkg.isEmpty()) {
s.checkPackageAccess(pkg);