RFR: 8346107: Generators: testing utility for random value generation [v2]

Emanuel Peter epeter at openjdk.org
Wed Dec 18 12:56:40 UTC 2024


On Wed, 18 Dec 2024 08:15:44 GMT, theoweidmannoracle <duke at openjdk.org> wrote:

>> Emanuel Peter has updated the pull request incrementally with three additional commits since the last revision:
>> 
>>  - use Generators.Random, rm some imports
>>  - rm whitespace
>>  - Extra documentation, and review suggestions v1
>
> I think these classes will be extremely helpful! I left some (nitpicky) comments.

@theoweidmannoracle Thanks a lot for reviewing, and all the suggestions. I addressed everything except your idea with sharing code between `MixedIntGenerator` and `MixedLongGenerator`, and between `SpecialDoubleGenerator` and `SpecialFloatGenerator`.

I would have to make the classes `FloatGenerator` and `DoubleGenerator` interfaces. But having default methods for interfaces is not really the recommended way, as far as I know. And then I cannot make those default methods final, which sucks - java does not allow it. So I would have to create the shared code in a separate class, that would then be used by composition in the other classes.

I really don't think that abstraction is worth it. It would end up with the same amount of code in the original files, plus the extra code in the new shared file.

If you don't agree with my opinion, then I suppose we have to let a 3rd person decide ;)

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

PR Comment: https://git.openjdk.org/jdk/pull/22716#issuecomment-2551252653


More information about the hotspot-compiler-dev mailing list