Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8336936

Add @implSpec for the default implementations in Process.waitFor()

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 24
    • core-libs
    • None
    • behavioral
    • minimal
    • Minimal, as this is a doc only change.
    • Java API
    • SE

      Summary

      Add @implSpec tag to the paragraphs that explain the default implementations of waitFor() methods.

      Problem

      It might not have been clear enough to describe that they were the implementation specifications.

      Solution

      Prepend @implSpec tags to the overloads of java.lang.Process#waitFor(long, TimeUnit) and java.lang.Process#waitFor(Duration) methods.

      Specification

      Modify the method descriptions of waitFor() in java.langProcess as follows:

      waitFor(long, TimeUnit):

             * <p>If the process has already terminated then this method returns
             * immediately with the value {@code true}.  If the process has not
             * terminated and the timeout value is less than, or equal to, zero, then
             * this method returns immediately with the value {@code false}.
             *
      -      * <p>The default implementation of this method polls the {@code exitValue}
      -      * to check if the process has terminated. Concrete implementations of this
      -      * class are strongly encouraged to override this method with a more
      -      * efficient implementation.
      +      * @implSpec
      +      * The default implementation of this method polls the {@code exitValue}
      +      * to check if the process has terminated.
      +      * @implNote
      +      * Concrete implementations of this class are strongly encouraged to
      +      * override this method with a more efficient implementation.
             *
             * @param timeout the maximum time to wait

      waitFor(Duration):

             * <p>If the process has already terminated then this method returns
             * immediately with the value {@code true}.  If the process has not
             * terminated and the duration is not positive, then
             * this method returns immediately with the value {@code false}.
             *
      -      * <p>The default implementation of this method polls the {@code exitValue}
      -      * to check if the process has terminated. Concrete implementations of this
      -      * class are strongly encouraged to override this method with a more
      -      * efficient implementation.
      +      * @implSpec
      +      * The default implementation of this method polls the {@code exitValue}
      +      * to check if the process has terminated.
      +      * @implNote
      +      * Concrete implementations of this class are strongly encouraged to
      +      * override this method with a more efficient implementation.
             *
             * @param duration the maximum duration to wait; if not positive,

            naoto Naoto Sato
            naoto Naoto Sato
            Brian Burkhalter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: