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

Claes Redestad redestad at openjdk.org
Sun Sep 15 12:59:21 UTC 2024


On Sat, 14 Sep 2024 20:35:30 GMT, Chen Liang <liach at openjdk.org> wrote:

>> The public methods used to throw `IllegalArgumentException` when duplicate class options were passed though, as a result of using [`Set.of(…)`].
>> 
>> [`Set.of(…)`]: https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/util/Set.html#of(E...)
>
> Good note, we might check the option bit is unset before bitwise-or the option bit, or remove this check (this behavior is not specified by this API and might not be relied on)

While the public API specifies IAE to be thrown but not for the case of providing duplicate class options, it would still be behavior change that would require a CSR. And fail-fast is good. I'll add a `Set.of(options)` in the public methods to effect the invariants.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21002#discussion_r1760041593


More information about the core-libs-dev mailing list