Integrated: 8272567: [IR Framework] Make AbstractInfo.getRandom() static
Christian Hagedorn
chagedorn at openjdk.java.net
Wed Aug 18 06:42: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
This pull request has now been integrated.
Changeset: 79a06df8
Author: Christian Hagedorn <chagedorn at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/79a06df8113ba1da55db5c38fe34608c3507c223
Stats: 3 lines in 2 files changed: 0 ins; 0 del; 3 mod
8272567: [IR Framework] Make AbstractInfo.getRandom() static
Reviewed-by: thartmann
-------------
PR: https://git.openjdk.java.net/jdk/pull/5139
More information about the hotspot-compiler-dev
mailing list