mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8303485: Replacing os.name for operating system customization
Reviewed-by: naoto, erikj, alanb
This commit is contained in:
parent
87b314a985
commit
6c3b10fb1d
13 changed files with 371 additions and 114 deletions
|
@ -77,6 +77,7 @@ import java.util.jar.Manifest;
|
|||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import jdk.internal.util.OperatingSystem;
|
||||
import jdk.internal.misc.VM;
|
||||
import jdk.internal.module.ModuleBootstrap;
|
||||
import jdk.internal.module.Modules;
|
||||
|
@ -168,7 +169,7 @@ public final class LauncherHelper {
|
|||
printLocale();
|
||||
break;
|
||||
case "system":
|
||||
if (System.getProperty("os.name").contains("Linux")) {
|
||||
if (OperatingSystem.isLinux()) {
|
||||
printSystemMetrics();
|
||||
break;
|
||||
}
|
||||
|
@ -176,7 +177,7 @@ public final class LauncherHelper {
|
|||
printVmSettings(initialHeapSize, maxHeapSize, stackSize);
|
||||
printProperties();
|
||||
printLocale();
|
||||
if (System.getProperty("os.name").contains("Linux")) {
|
||||
if (OperatingSystem.isLinux()) {
|
||||
printSystemMetrics();
|
||||
}
|
||||
break;
|
||||
|
@ -532,7 +533,7 @@ public final class LauncherHelper {
|
|||
initOutput(printToStderr);
|
||||
ostream.println(getLocalizedMessage("java.launcher.X.usage",
|
||||
File.pathSeparator));
|
||||
if (System.getProperty("os.name").contains("OS X")) {
|
||||
if (OperatingSystem.isMacOS()) {
|
||||
ostream.println(getLocalizedMessage("java.launcher.X.macosx.usage",
|
||||
File.pathSeparator));
|
||||
}
|
||||
|
@ -745,7 +746,7 @@ public final class LauncherHelper {
|
|||
Class<?> c = null;
|
||||
try {
|
||||
c = Class.forName(m, mainClass);
|
||||
if (c == null && System.getProperty("os.name", "").contains("OS X")
|
||||
if (c == null && OperatingSystem.isMacOS()
|
||||
&& Normalizer.isNormalized(mainClass, Normalizer.Form.NFD)) {
|
||||
|
||||
String cn = Normalizer.normalize(mainClass, Normalizer.Form.NFC);
|
||||
|
@ -789,7 +790,7 @@ public final class LauncherHelper {
|
|||
try {
|
||||
mainClass = Class.forName(cn, false, scl);
|
||||
} catch (NoClassDefFoundError | ClassNotFoundException cnfe) {
|
||||
if (System.getProperty("os.name", "").contains("OS X")
|
||||
if (OperatingSystem.isMacOS()
|
||||
&& Normalizer.isNormalized(cn, Normalizer.Form.NFD)) {
|
||||
try {
|
||||
// On Mac OS X since all names with diacritical marks are
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue