Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6620549
Votes 0
Synopsis ExecutorService#shutdown should clearly state that it does not block
Category java:classes_util_concurrent
Reported Against
Release Fixed 7(b25)
State 10-Fix Delivered, bug
Priority: 3-Medium
Related Bugs
Submit Date 23-OCT-2007
Description
A DESCRIPTION OF THE REQUEST :
I've several times encountered that people call ExecutorService#shutdown and expect it to block until the remaining tasks have executed (awaitTermination does that for you). Only a code sample in the general class section suggests that #shutdown does not wait. Maybe the method should have been called #initiateShutdown.

The JavaDoc could make this more clear, through a @see #awaitTermination cross reference or similar.


JUSTIFICATION :
I have anecdotal evidence that this is a common misconception.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The method javadoc of #shutdown clearly states that shutdown does not wait for the current tasks to finish.
ACTUAL -
You have to read the general section or see the #awaitTermination method in order to learn this.
Posted Date : 2007-10-23 20:21:30.0
Work Around
N/A
Evaluation
Agreed.
Posted Date : 2007-10-28 16:12:08.0
Comments
  
  Include a link with my name & email   

Submitted On 18-NOV-2007
matthias.ernst
related: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6628607



PLEASE NOTE: JDK6 is formerly known as Project Mustang