RFR: 8347491: IllegalArgumentationException thrown by ThreadPoolExecutor doesn't have a useful message [v4]
Viktor Klang
vklang at openjdk.org
Tue May 6 10:21:21 UTC 2025
On Fri, 18 Apr 2025 03:22:28 GMT, He-Pin(kerr) <duke at openjdk.org> wrote:
>> Motivation:
>> When a user passes a wrong parameter, the current implementation throws an IllegalArgumentException with an error message `null`, which is not helpful.
>>
>> Modification:
>> Add detail error messages.
>>
>> Result:
>> Helpful messages.
>
> He-Pin(kerr) has updated the pull request incrementally with one additional commit since the last revision:
>
> chore: fix test error with the help of klang
src/java.base/share/classes/java/util/concurrent/AbstractExecutorService.java line 158:
> 156: private <T> T doInvokeAny(Collection<? extends Callable<T>> tasks,
> 157: boolean timed, long nanos)
> 158: throws InterruptedException, ExecutionException, TimeoutException, NullPointerException {
NullPointerException is a RuntimeException
Suggestion:
throws InterruptedException, ExecutionException, TimeoutException {
src/java.base/share/classes/java/util/concurrent/AbstractExecutorService.java line 264:
> 262: @Override
> 263: public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks)
> 264: throws InterruptedException , NullPointerException {
NullPointerException is a RuntimeException
Suggestion:
throws InterruptedException {
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23050#discussion_r2075163173
PR Review Comment: https://git.openjdk.org/jdk/pull/23050#discussion_r2075163888
More information about the core-libs-dev
mailing list