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

Incorrect javadoc description of ThreadPoolExecutor constructors

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 8, 11, 13, 14, 15
    • Fix Version/s: None
    • Component/s: core-libs

      Description

      ADDITIONAL SYSTEM INFORMATION :
      Linux , windows

      A DESCRIPTION OF THE PROBLEM :
      Url : https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ThreadPoolExecutor.html

      do visit the URL mentioned above , and read the constructor description
      (1.)ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, RejectedExecutionHandler handler)
      Creates a new ThreadPoolExecutor with the given initial parameters and default thread factory.

      (2.)ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)
      Creates a new ThreadPoolExecutor with the given initial parameters and default rejected execution handler.

      As per my understanding the information regarding the constructor has been interchanged . the correct statements should be as follows :

      (1.) ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, RejectedExecutionHandler handler)
      Creates a new ThreadPoolExecutor with the given initial parameters and default rejected execution handler.
      (2.) ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)
      Creates a new ThreadPoolExecutor with the given initial parameters and default thread factory.

      can you compare the two constructor statements and description , you would find the changes , I just swapped the description for the two mentioned constructor.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. please refer this url -https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ThreadPoolExecutor.html

      ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, RejectedExecutionHandler handler)
      Creates a new ThreadPoolExecutor with the given initial parameters and default rejected execution handler.
      ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)
      Creates a new ThreadPoolExecutor with the given initial parameters and default thread factory.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, RejectedExecutionHandler handler)
      Creates a new ThreadPoolExecutor with the given initial parameters and default rejected execution handler.
      ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)
      Creates a new ThreadPoolExecutor with the given initial parameters and default thread factory.
      ACTUAL -
      ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, RejectedExecutionHandler handler)
      Creates a new ThreadPoolExecutor with the given initial parameters and default rejected execution handler.
      ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)
      Creates a new ThreadPoolExecutor with the given initial parameters and default thread factory.

      ---------- BEGIN SOURCE ----------
      ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, RejectedExecutionHandler handler)
      Creates a new ThreadPoolExecutor with the given initial parameters and default rejected execution handler.
      ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)
      Creates a new ThreadPoolExecutor with the given initial parameters and default thread factory.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ThreadPoolExecutor.html

      ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, RejectedExecutionHandler handler)
      Creates a new ThreadPoolExecutor with the given initial parameters and default rejected execution handler.
      ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)
      Creates a new ThreadPoolExecutor with the given initial parameters and default thread factory.

        Attachments

          Activity

            People

            • Assignee:
              martin Martin Buchholz
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: