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
--- a/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java Fri Jan 30 12:56:12 2015 -0800
+++ b/jdk/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/jdk/src/java.base/share/classes/java/lang/Runtime.java Fri Jan 30 12:56:12 2015 -0800
+++ b/jdk/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
*