changeset 11339:fd267d27e64c

8055330: (process spec) ProcessBuilder.start and Runtime.exec should throw UnsupportedOperationException on platforms that don't support Summary: Clarify optional behavior and the exception thrown when not supported Reviewed-by: dfuchs, martin
author rriggs
date Fri, 30 Jan 2015 16:13:04 -0500
parents 9017c96ff81f
children bd4d6a62e1fd
files src/java.base/share/classes/java/lang/ProcessBuilder.java src/java.base/share/classes/java/lang/Runtime.java
diffstat 2 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/lang/ProcessBuilder.java	Fri Jan 30 12:56:12 2015 -0800
+++ b/src/java.base/share/classes/java/lang/ProcessBuilder.java	Fri Jan 30 16:13:04 2015 -0500
@@ -951,6 +951,9 @@
      * {@code command} array as its argument. This may result in
      * a {@link SecurityException} being thrown.
      *
+     * <p>If the operating system does not support the creation of
+     * processes, an {@link UnsupportedOperationException} will be thrown.
+     *
      * <p>Starting an operating system process is highly system-dependent.
      * Among the many things that can go wrong are:
      * <ul>
@@ -998,6 +1001,9 @@
      *
      *         </ul>
      *
+     * @throws  UnsupportedOperationException
+     *          If the operating system does not support the creation of processes.
+     *
      * @throws IOException if an I/O error occurs
      *
      * @see Runtime#exec(String[], String[], java.io.File)
--- a/src/java.base/share/classes/java/lang/Runtime.java	Fri Jan 30 12:56:12 2015 -0800
+++ b/src/java.base/share/classes/java/lang/Runtime.java	Fri Jan 30 16:13:04 2015 -0500
@@ -564,6 +564,9 @@
      * <code>cmdarray</code> as its argument. This may result in a
      * {@link SecurityException} being thrown.
      *
+     * <p>If the operating system does not support the creation of
+     * processes, an {@link UnsupportedOperationException} will be thrown.
+     *
      * <p>Starting an operating system process is highly system-dependent.
      * Among the many things that can go wrong are:
      * <ul>
@@ -597,6 +600,9 @@
      *          {@link SecurityManager#checkExec checkExec}
      *          method doesn't allow creation of the subprocess
      *
+     * @throws  UnsupportedOperationException
+     *          If the operating system does not support the creation of processes.
+     *
      * @throws  IOException
      *          If an I/O error occurs
      *