On Mon, 2 May 2022 10:23:01 GMT, Doug Lea <d...@openjdk.org> wrote:

>> src/java.base/share/classes/java/util/concurrent/ExecutorService.java line 
>> 138:
>> 
>>> 136:  * @author Doug Lea
>>> 137:  */
>>> 138: public interface ExecutorService extends Executor, AutoCloseable {
>> 
>> The class documentation should be expanded to explain that an 
>> ExecutorService can be used with a try-with-resources
>
> Most AutoCloseables do not mention this in class-level javadocs. Is there a 
> reason you think this one should?

close() is now equivalent to the method shutdownAndAwaitTermination() shown in 
the javadoc so i believe , replacing it with a try-with-resources is better in 
term of documenting how an executor service can be used

-------------

PR: https://git.openjdk.java.net/jdk/pull/8490

Reply via email to