RFR: 8359919: Minor java.util.concurrent doc improvements [v8]

Doug Lea dl at openjdk.org
Fri Jun 20 13:27:32 UTC 2025


On Fri, 20 Jun 2025 12:47:43 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Doug Lea has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Adding JDK-8333172 to doc improvements
>
> src/java.base/share/classes/java/util/concurrent/ScheduledExecutorService.java line 48:
> 
>> 46:  * that {@code scheduleAtFixedRate} and {@code scheduleWithFixedDelay}
>> 47:  * methods create and execute tasks that run periodically until
>> 48:  * cancelled.
> 
> I think this wording, and use of "enabled", is good.
> 
> In passing, the first paragraph schedule "tasks" but returns "a task object". It might be saying that it returns task objects.

Thanks. Reworded as:
The {@code schedule} methods create tasks with various delays
 * and return {@link ScheduledFuture} objects that can be used to cancel or check
 * execution.

> src/java.base/share/classes/java/util/concurrent/locks/ReentrantReadWriteLock.java line 794:
> 
>> 792:         /**
>> 793:          * Acquires the read lock only if the write lock is not held by
>> 794:          * any thread at the time of invocation.
> 
> A writer can acquire the read lock. So if the current thread has the write lock then it will acquire the read lock. So maybe "another thread" is okay?

Thanks; reverted. One too many find-replaces/

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25880#discussion_r2158985285
PR Review Comment: https://git.openjdk.org/jdk/pull/25880#discussion_r2158992376


More information about the core-libs-dev mailing list