8282701: Use Class.getInterfaces(false) where possible to reduce allocation pressure

Reviewed-by: redestad, mchung
This commit is contained in:
Sergey Tsypanov 2022-05-10 17:19:33 +00:00 committed by Mandy Chung
parent 0f3773635d
commit 9073a98d57

View file

@ -3125,7 +3125,7 @@ public final class Class<T> implements java.io.Serializable,
}
// check package access on the proxy interfaces
if (checkProxyInterfaces && Proxy.isProxyClass(this)) {
ReflectUtil.checkProxyPackageAccess(ccl, this.getInterfaces());
ReflectUtil.checkProxyPackageAccess(ccl, this.getInterfaces(/* cloneArray */ false));
}
}
@ -3373,7 +3373,7 @@ public final class Class<T> implements java.io.Serializable,
addAll(fields, privateGetDeclaredFields(true));
// Direct superinterfaces, recursively
for (Class<?> si : getInterfaces()) {
for (Class<?> si : getInterfaces(/* cloneArray */ false)) {
addAll(fields, si.privateGetPublicFields());
}