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

Reviewed-by: thartmann
This commit is contained in:
Christian Hagedorn 2021-08-18 06:39:22 +00:00
parent 481c1f0549
commit 79a06df811
2 changed files with 3 additions and 3 deletions

View File

@ -56,7 +56,7 @@ abstract public class AbstractInfo {
*
* @return the random object.
*/
public Random getRandom() {
public static Random getRandom() {
return RANDOM;
}

View File

@ -103,9 +103,9 @@ public class CustomRunTestExample {
// This version of @Run passes the RunInfo object as an argument. No other arguments and combiniations are allowed.
@Run(test = "test2")
public void runWithRunInfo(RunInfo info) {
public void runWithRunInfo() {
// We could also skip some invocations. This might have an influence on possible @IR rules, need to be careful.
if (info.getRandom().nextBoolean()) {
if (RunInfo.getRandom().nextBoolean()) {
int returnValue = test(34);
if (returnValue != 34) {
throw new RuntimeException("Must match");