RFR: 8340131: Refactor internal makeHiddenClassDefiner to take ClassOption ... instead of Set [v5]

Claes Redestad redestad at openjdk.org
Sun Sep 15 20:45:06 UTC 2024


On Sun, 15 Sep 2024 12:59:21 GMT, Claes Redestad <redestad at openjdk.org> wrote:

>> Simple internal refactor to load a few classes less on startup. Arguably cleaner and avoids some iterator allocations.
>
> Claes Redestad has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Improve edge invariant checks

> Commit [62a88c0](https://github.com/openjdk/jdk/commit/62a88c0368512e993df09c14d1b98b28b20e3280) introduced a TOCTOU issue caused by double‑reading of a user‑supplied array

1. Switching to a null value will trigger a NPE when evaluating the option. 
2. Switching values after validation just changes the options from one legal result to another. Weird, but benign. 

I don't think this requires a fix, but putting in a `options = Set.of(options).toArray(NO_OPTIONS);` wouldn't be too bad.

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

PR Comment: https://git.openjdk.org/jdk/pull/21002#issuecomment-2351785168


More information about the core-libs-dev mailing list