On Sat, 14 Sep 2024 20:35:30 GMT, Chen Liang <li...@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

Reply via email to