changeset 12808:aa7cccf1a672

8132883: The spec of allChildren/children of j.l.Process/ProcessHandle need to be relaxed 8131763: j.l.Process.allChildren spec clarification Reviewed-by: chegar
author rriggs
date Wed, 23 Sep 2015 15:02:46 -0400
parents e35164a24594
children 8292f92a37b7
files src/java.base/share/classes/java/lang/Process.java src/java.base/share/classes/java/lang/ProcessHandle.java
diffstat 2 files changed, 18 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/lang/Process.java	Wed Sep 23 11:18:34 2015 -0400
+++ b/src/java.base/share/classes/java/lang/Process.java	Wed Sep 23 15:02:46 2015 -0400
@@ -500,7 +500,8 @@
 
     /**
      * Returns a snapshot of the direct children of the process.
-     * A process that is {@link #isAlive not alive} has zero children.
+     * The parent of a direct child process is the process.
+     * Typically, a process that is {@link #isAlive not alive} has no children.
      * <p>
      * <em>Note that processes are created and terminate asynchronously.
      * There is no guarantee that a process is {@link #isAlive alive}.
@@ -510,8 +511,8 @@
      * This implementation returns the direct children as:
      * {@link #toHandle toHandle().children()}.
      *
-     * @return a Stream of ProcessHandles for processes that are direct children
-     *         of the process
+     * @return a sequential Stream of ProcessHandles for processes that are
+     *         direct children of the process
      * @throws UnsupportedOperationException if the Process implementation
      *         does not support this operation
      * @throws SecurityException if a security manager has been installed and
@@ -524,7 +525,9 @@
 
     /**
      * Returns a snapshot of the direct and indirect children of the process.
-     * A process that is {@link #isAlive not alive} has zero children.
+     * An indirect child is one whose parent is either a direct child or
+     * another indirect child.
+     * Typically, a process that is {@link #isAlive not alive} has no children.
      * <p>
      * <em>Note that processes are created and terminate asynchronously.
      * There is no guarantee that a process is {@link #isAlive alive}.
@@ -534,8 +537,8 @@
      * This implementation returns all children as:
      * {@link #toHandle toHandle().allChildren()}.
      *
-     * @return a Stream of ProcessHandles for processes that are direct and
-     *         indirect children of the process
+     * @return a sequential Stream of ProcessHandles for processes that are
+     *         direct and indirect children of the process
      * @throws UnsupportedOperationException if the Process implementation
      *         does not support this operation
      * @throws SecurityException if a security manager has been installed and
--- a/src/java.base/share/classes/java/lang/ProcessHandle.java	Wed Sep 23 11:18:34 2015 -0400
+++ b/src/java.base/share/classes/java/lang/ProcessHandle.java	Wed Sep 23 15:02:46 2015 -0400
@@ -149,14 +149,15 @@
 
     /**
      * Returns a snapshot of the current direct children of the process.
-     * A process that is {@link #isAlive not alive} has zero children.
+     * The {@link #parent} of a direct child process is the process.
+     * Typically, a process that is {@link #isAlive not alive} has no children.
      * <p>
      * <em>Note that processes are created and terminate asynchronously.
      * There is no guarantee that a process is {@link #isAlive alive}.
      * </em>
      *
-     * @return a Stream of ProcessHandles for processes that are direct children
-     *         of the process
+     * @return a sequential Stream of ProcessHandles for processes that are
+     *         direct children of the process
      * @throws SecurityException if a security manager has been installed and
      *         it denies RuntimePermission("manageProcess")
      */
@@ -164,14 +165,16 @@
 
     /**
      * Returns a snapshot of the current direct and indirect children of the process.
-     * A process that is {@link #isAlive not alive} has zero children.
+     * An indirect child is one whose parent is either a direct child or
+     * another indirect child.
+     * Typically, a process that is {@link #isAlive not alive} has no children.
      * <p>
      * <em>Note that processes are created and terminate asynchronously.
      * There is no guarantee that a process is {@link #isAlive alive}.
      * </em>
      *
-     * @return a Stream of ProcessHandles for processes that are direct and
-     *         indirect children of the process
+     * @return a sequential Stream of ProcessHandles for processes that are
+     *         direct and indirect children of the process
      * @throws SecurityException if a security manager has been installed and
      *         it denies RuntimePermission("manageProcess")
      */