RFR: 8347491: IllegalArgumentationException thrown by ThreadPoolExecutor doesn't have a useful message [v3]
He-Pin (kerr)
duke at openjdk.org
Fri Apr 18 03:16:48 UTC 2025
On Fri, 28 Mar 2025 13:19:50 GMT, Viktor Klang <vklang at openjdk.org> wrote:
>> He-Pin(kerr) has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - .
>> - .
>
> test/jdk/java/util/concurrent/tck/ThreadPoolExecutorTest.java line 44:
>
>> 42: import java.util.Collections;
>> 43: import java.util.List;
>> 44: import java.util.concurrent.ArrayBlockingQueue;
>
> Hi @He-Pin,
>
> I needed to perform the following changes to get this test to compile, and run successfully:
>
>
> diff --git a/test/jdk/java/util/concurrent/tck/ThreadPoolExecutorTest.java b/test/jdk/java/util/concurrent/tck/ThreadPoolExecutorTest.java
> index f23c421f97e..d9ce643a26d 100644
> --- a/test/jdk/java/util/concurrent/tck/ThreadPoolExecutorTest.java
> +++ b/test/jdk/java/util/concurrent/tck/ThreadPoolExecutorTest.java
> @@ -291,7 +291,7 @@ public void testSetThreadFactoryNull() {
> p.setThreadFactory(null);
> shouldThrow();
> } catch (NullPointerException success) {
> - Assert.assertEquals("threadFactory", success.getMessage());
> + assertEquals("threadFactory", success.getMessage());
> }
> }
> }
> @@ -353,7 +353,7 @@ public void testSetRejectedExecutionHandlerNull() {
> p.setRejectedExecutionHandler(null);
> shouldThrow();
> } catch (NullPointerException success) {
> - Assert.assertEquals("handler", success.getMessage());
> + assertEquals("handler", success.getMessage());
> }
> }
> }
> @@ -728,7 +728,7 @@ public void testConstructor1() {
> new ArrayBlockingQueue<Runnable>(10));
> shouldThrow();
> } catch (IllegalArgumentException success) {
> - Assert.assertEquals("corePoolSize must be non-negative");
> + assertEquals("corePoolSize must be non-negative", success.getMessage());
> }
> }
>
> @@ -741,7 +741,7 @@ public void testConstructor2() {
> new ArrayBlockingQueue<Runnable>(10));
> shouldThrow();
> } catch (IllegalArgumentException success) {
> - Assert.assertEquals("maximumPoolSize must be positive");
> + assertEquals("maximumPoolSize must be positive", success.getMessage());
> }
> }
>
> @@ -754,7 +754,7 @@ public void testConstructor3() {
> new ArrayBlockingQueue<Runnable>(10));
> shouldThrow();
> } catch (IllegalArgumentException success) {
> - Assert.assertEquals("maximumPoolSize must be positive", success.getMessage());
> + assertEquals("maximumPoolSize must be positive", s...
Thank you.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23050#discussion_r2049945473
More information about the core-libs-dev
mailing list