RFR: 8301220: Return value of toArray() of Сollection types from java.base should be trusted [v2]
Glavo
duke at openjdk.org
Fri Jan 27 20:43:15 UTC 2023
On Fri, 27 Jan 2023 14:28:08 GMT, Alan Bateman <alanb at openjdk.org> wrote:
> I skimmed through the latest update. I see you've considered the possibility of a Matryoshka doll showing up but the optimization is still very very scary. I think it would require an audit of every API in java.base that potentially wraps a collection. It might be better to focus on a few specific cases that can be proven to be safe.
It is good to limit the trusted collection to a set of known collections. I am thinking about the best way to implement it. I hope that the impact on performance will be as small as possible.
-------------
PR: https://git.openjdk.org/jdk/pull/12212
More information about the core-libs-dev
mailing list