Skip to content

Commit

Permalink
Set vm.bits property
Browse files Browse the repository at this point in the history
Signed-off-by: Sophia Guo <sophia.gwf@gmail.com>
  • Loading branch information
sophia-guo committed Nov 5, 2020
1 parent dd469ee commit d67624c
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions closed/test/jtreg-ext/requires/OpenJ9PropsExt.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ===========================================================================
* (c) Copyright IBM Corp. 2019, 2019 All Rights Reserved
* (c) Copyright IBM Corp. 2019, 2020 All Rights Reserved
* ===========================================================================
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -30,15 +30,30 @@
import java.util.concurrent.Callable;

public class OpenJ9PropsExt implements Callable<Map<String, String>> {

private static final String ERROR_STATE = "__ERROR__";
@Override
public Map<String, String> call() {

Map<String, String> 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");
}
}
}

0 comments on commit d67624c

Please sign in to comment.