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

Mandy Chung mchung at openjdk.java.net
Mon May 2 16:22:49 UTC 2022


On Sat, 5 Mar 2022 13:07:56 GMT, Сергей Цыпанов <duke at openjdk.java.net> wrote:

> `Class.getInterfaces(false)` does not clone underlying array and can be used in cases when the returned array is only read from.

For the `checkPackageAccess` case, I don't think it worths fixing; not only that security manager is deprecated for removal but also when security manager is enabled, there are lots of allocations for other security checks.

So the `getInterface(boolean)` method can be kept private.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7714


More information about the core-libs-dev mailing list