Skip to content

Commit 9a4d4b2

Browse files
authored
Merge pull request #246 from sophia-guo/prop
Set vm.bits property
2 parents f702105 + 6892b5a commit 9a4d4b2

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

closed/test/jtreg-ext/requires/OpenJ9PropsExt.java

+20-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* ===========================================================================
3-
* (c) Copyright IBM Corp. 2019, 2019 All Rights Reserved
3+
* (c) Copyright IBM Corp. 2019, 2020 All Rights Reserved
44
* ===========================================================================
55
*
66
* This code is free software; you can redistribute it and/or modify it
@@ -35,10 +35,26 @@ public class OpenJ9PropsExt implements Callable<Map<String, String>> {
3535
public Map<String, String> call() {
3636

3737
Map<String, String> map = new HashMap<>();
38-
map.put("vm.graal.enabled", "false");
39-
38+
try {
39+
map.put("vm.graal.enabled", "false");
40+
map.put("vm.bits", vmBits());
41+
}
42+
catch (Exception e) {
43+
e.printStackTrace();
44+
System.exit(1);
45+
}
4046
return map;
4147
}
4248

49+
/**
50+
* @return VM bitness, the value of the "sun.arch.data.model" property.
51+
*/
52+
protected String vmBits() throws Exception {
53+
String dataModel = System.getProperty("sun.arch.data.model");
54+
if (dataModel != null) {
55+
return dataModel;
56+
} else {
57+
throw new Exception("Can't get 'sun.arch.data.model' property");
58+
}
59+
}
4360
}
44-

0 commit comments

Comments
 (0)