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.
|