diff options
Diffstat (limited to 'luni/src/main/java/java/lang/ProcessManager.java')
-rw-r--r-- | luni/src/main/java/java/lang/ProcessManager.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/luni/src/main/java/java/lang/ProcessManager.java b/luni/src/main/java/java/lang/ProcessManager.java index 1e820a9..28314b7 100644 --- a/luni/src/main/java/java/lang/ProcessManager.java +++ b/luni/src/main/java/java/lang/ProcessManager.java @@ -168,10 +168,10 @@ final class ProcessManager { boolean redirectErrorStream) throws IOException { // Make sure we throw the same exceptions as the RI. if (taintedCommand == null) { - throw new NullPointerException(); + throw new NullPointerException("taintedCommand == null"); } if (taintedCommand.length == 0) { - throw new IndexOutOfBoundsException(); + throw new IndexOutOfBoundsException("taintedCommand.length == 0"); } // Handle security and safety by copying mutable inputs and checking them. @@ -179,16 +179,16 @@ final class ProcessManager { String[] environment = taintedEnvironment != null ? taintedEnvironment.clone() : null; // Check we're not passing null Strings to the native exec. - for (String arg : command) { - if (arg == null) { - throw new NullPointerException(); + for (int i = 0; i < command.length; i++) { + if (command[i] == null) { + throw new NullPointerException("taintedCommand[" + i + "] == null"); } } // The environment is allowed to be null or empty, but no element may be null. if (environment != null) { - for (String env : environment) { - if (env == null) { - throw new NullPointerException(); + for (int i = 0; i < environment.length; i++) { + if (environment[i] == null) { + throw new NullPointerException("taintedEnvironment[" + i + "] == null"); } } } |