RFR: 8346107: Generators: testing utility for random value generation

Emanuel Peter epeter at openjdk.org
Tue Jan 7 14:11:40 UTC 2025


On Tue, 7 Jan 2025 14:07:33 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Currently the mixed generator does not even support restricting, but I think that's something that I should still add, also with regard to your comment above.
>> 
>>> What if I mix distributions, and one of them has no values from that range, but the other does?
>> 
>> I would make the mixed generator call `restricted` on both its generators, which might in turn throw EmptyGeneratorException, if they cannot be restricted to that range.
>
> You could fix it this way: when you restrict mixed generators, you try to recursively restrict all its sub-generators. If one cannot be restricted, you do not throw, but just remove it from the mixed distribution ;)

Only if none remain -> throw

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22941#discussion_r1905508443


More information about the hotspot-compiler-dev mailing list