RFR: 8272567: [IR Framework] Make AbstractInfo.getRandom() static

Christian Hagedorn chagedorn at openjdk.java.net
Tue Aug 17 10:48:26 UTC 2021


On Tue, 17 Aug 2021 10:14:14 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

> To use the dedicated (`private static final`) `Random` object of `AbstractInfo` one needs to use the non-static `getRandom()` method like this:
> 
> 
> @Run(test = "myTest")
> public void runMethodForMyTest(RunInfo info) {
>    int x = info.getRandom().nextInt();
>    myTest(x);
> }
> 
> 
> This simple patch makes `getRandom()` static to provide an easier access to it without the need to specify `RunInfo` as parameter:
> 
> 
> @Run(test = "myTest")
> public void runMethodForMyTest() {
>    int x = RunInfo.getRandom().nextInt(); // or AbstractInfo.getRandom().nextInt()
>    myTest(x);
> }
> 
> 
> Thanks,
> Christian

Thanks Tobias for your review!

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

PR: https://git.openjdk.java.net/jdk/pull/5139


More information about the hotspot-compiler-dev mailing list