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

Emanuel Peter epeter at openjdk.org
Wed Dec 18 11:56:37 UTC 2024


On Wed, 18 Dec 2024 11:46:28 GMT, theoweidmannoracle <duke at openjdk.org> wrote:

>> Again: I'm not sure if doing this with more complicated and more generic code is really easier than a bit of code duplication. Not that I'm in general an advocate for code duplication 🙈 😅
>
> What I'm thinking of doesn't involve any generics. I'm talking about specialMinFrequency, specialMaxFrequency, specialCountDown and the logic in next* to decide whether to provide a special value or not now. This is independent from whether float or double is used, as far as I can tell.

Ok. I suppose I could factor this out into some extra class and extra file.
But is that worth it? Then I need to still somehow route all that logic through the constructor, and `nextDouble`. I think in the end I have more code and more abstractions, I don't yet see how that is worth it.

Maybe you had a better idea in mind that I did not yet think of ;)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22716#discussion_r1890112274


More information about the hotspot-compiler-dev mailing list