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

javadoc is wrong for ThreadPoolExecutor.setMaximumPoolSize(int)

XMLWordPrintable

      A DESCRIPTION OF THE PROBLEM :
      the javadoc comment for

      java.lang.concurent.ThreadPoolExecutor#setMaximumPoolSize(int maximumPoolSize)

        states that

      "@throws IllegalArgumentException - if maximumPoolSize less than zero or the core pool size"

      however after inspecting the source code, the method starts with the following code

      "if (maximumPoolSize <= 0 || maximumPoolSize < corePoolSize)
                  throw new IllegalArgumentException();"

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      the javadoc comment should say

      "@throws IllegalArgumentException - if maximumPoolSize less than or equal to zero or less than core pool size".

      This would be consistent with the javadoc comments for the constructors of this calss.
      ACTUAL -
      "@throws IllegalArgumentException - if maximumPoolSize less than zero or the core pool size"

      URL OF FAULTY DOCUMENTATION :
      http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ThreadPoolExecutor.html#setMaximumPoolSize(int)

            martin Martin Buchholz
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: