diff --git a/closed/test/jtreg-ext/requires/OpenJ9PropsExt.java b/closed/test/jtreg-ext/requires/OpenJ9PropsExt.java index d3047068e0f..6adfd5659de 100644 --- a/closed/test/jtreg-ext/requires/OpenJ9PropsExt.java +++ b/closed/test/jtreg-ext/requires/OpenJ9PropsExt.java @@ -30,15 +30,30 @@ import java.util.concurrent.Callable; public class OpenJ9PropsExt implements Callable> { - + private static final String ERROR_STATE = "__ERROR__"; @Override public Map call() { Map map = new HashMap<>(); map.put("vm.graal.enabled", "false"); + map.put("vm.bits", vmBits()); return map; } - + private String errorWithMessage(String message) { + new Exception(message).printStackTrace(); + return ERROR_STATE + message; + } + /** + * @return VM bitness, the value of the "sun.arch.data.model" property. + */ + protected String vmBits() { + String dataModel = System.getProperty("sun.arch.data.model"); + if (dataModel != null) { + return dataModel; + } else { + return errorWithMessage("Can't get 'sun.arch.data.model' property"); + } + } }