From c7c9b4fdda194a78bfe780ea0c059add24dbda01 Mon Sep 17 00:00:00 2001 From: Sophia Guo Date: Thu, 5 Nov 2020 10:14:55 -0500 Subject: [PATCH] Set vm.bits property Signed-off-by: Sophia Guo --- .../jtreg-ext/requires/OpenJ9PropsExt.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) 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"); + } + } }