8234822: Limit ZGC jtreg-support to Windows 2019 Server

Reviewed-by: iignatyev, eosterlund
This commit is contained in:
Stefan Karlsson 2019-12-03 10:40:58 +01:00
parent aff41433b6
commit 802580b236

View File

@ -48,11 +48,28 @@ public enum GC {
this.name = name;
}
private boolean supportsOSVersion() {
if (this != Z) {
return true;
}
String osName = System.getProperty("os.name");
if (!osName.startsWith("Windows")) {
return true;
}
// ZGC has specific Windows version requirements (>= 1803).
// The following check should be made more precise to
// also catch the corresponding Windows 10 version.
return osName.equals("Windows Server 2019");
}
/**
* @return true if this GC is supported by the VM, i.e., it is built into the VM.
*/
public boolean isSupported() {
return WB.isGCSupported(name);
return WB.isGCSupported(name) && supportsOSVersion();
}
/**