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.

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

Commit messages:
 - .
 - chore: add messages for NPE
 - chore: tweak the error messages
 - chore: add test cases
 - 8347491: Add detail error messages when ThreadPoolExecutor's parameter is 
illegal.

Changes: https://git.openjdk.org/jdk/pull/23050/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23050&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8347491
  Stats: 164 lines in 3 files changed: 101 ins; 0 del; 63 mod
  Patch: https://git.openjdk.org/jdk/pull/23050.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23050/head:pull/23050

PR: https://git.openjdk.org/jdk/pull/23050

Reply via email to