JDK-8272567 : [IR Framework] Make AbstractInfo.getRandom() static
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17,18
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-08-17
  • Updated: 2021-08-19
  • Resolved: 2021-08-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 18
18 b11Fixed
Description
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);
}

It would be easier to make 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);
}
Comments
Changeset: 79a06df8 Author: Christian Hagedorn <chagedorn@openjdk.org> Date: 2021-08-18 06:39:22 +0000 URL: https://git.openjdk.java.net/jdk/commit/79a06df8113ba1da55db5c38fe34608c3507c223
18-08-2021