RFR: 8282701: Use Class.getInterfaces(false) where possible to reduce allocation pressure
Claes Redestad
redestad at openjdk.java.net
Mon May 2 15:12:44 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.
I think this ok in general, but for consistency and to better call out that we're dealing with a trusted shared array I would prefer if `getInterfaces(boolean)` remains private and instead we add a `getInterfacesShared()` (which simply call `getInterfaces(false)`).
-------------
Changes requested by redestad (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/7714
More information about the core-libs-dev
mailing list