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
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -25,6 +25,7 @@
|
|||
|
||||
package java.lang;
|
||||
|
||||
import jdk.internal.util.OperatingSystem;
|
||||
import java.io.File;
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.IOException;
|
||||
|
@ -35,7 +36,6 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import jdk.internal.event.ProcessStartEvent;
|
||||
import sun.security.action.GetPropertyAction;
|
||||
|
||||
/**
|
||||
* This class is used to create operating system processes.
|
||||
|
@ -469,9 +469,8 @@ public final class ProcessBuilder
|
|||
* @since 1.7
|
||||
*/
|
||||
public abstract static class Redirect {
|
||||
private static final File NULL_FILE = new File(
|
||||
(GetPropertyAction.privilegedGetProperty("os.name")
|
||||
.startsWith("Windows") ? "NUL" : "/dev/null")
|
||||
private static final File NULL_FILE =
|
||||
new File((OperatingSystem.isWindows() ? "NUL" : "/dev/null")
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue