Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c7c9b4f

Browse files
committedNov 5, 2020
Set vm.bits property
Signed-off-by: Sophia Guo <[email protected]>
1 parent dd469ee commit c7c9b4f

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed
 

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

+17-2
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,30 @@
3030
import java.util.concurrent.Callable;
3131

3232
public class OpenJ9PropsExt implements Callable<Map<String, String>> {
33-
33+
private static final String ERROR_STATE = "__ERROR__";
3434
@Override
3535
public Map<String, String> call() {
3636

3737
Map<String, String> map = new HashMap<>();
3838
map.put("vm.graal.enabled", "false");
39+
map.put("vm.bits", vmBits());
3940

4041
return map;
4142
}
42-
43+
private String errorWithMessage(String message) {
44+
new Exception(message).printStackTrace();
45+
return ERROR_STATE + message;
46+
}
47+
/**
48+
* @return VM bitness, the value of the "sun.arch.data.model" property.
49+
*/
50+
protected String vmBits() {
51+
String dataModel = System.getProperty("sun.arch.data.model");
52+
if (dataModel != null) {
53+
return dataModel;
54+
} else {
55+
return errorWithMessage("Can't get 'sun.arch.data.model' property");
56+
}
57+
}
4358
}
4459

0 commit comments

Comments
 (0)
Please sign in to comment.