RFR: 8229186: Improve error messages for TestStringIntrinsics failures [v9]

Evgeny Nikitin enikitin at openjdk.java.net
Fri Oct 9 07:15:46 UTC 2020


On Thu, 8 Oct 2020 20:42:12 GMT, Igor Ignatyev <iignatyev at openjdk.org> wrote:

>> Evgeny Nikitin has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add null values support and two-way testing
>
> test/lib/jdk/test/lib/format/ArrayDiff.java line 117:
> 
>> 115:         if (second == null) {
>> 116:             throw new IllegalArgumentException("Second array argument for ArrayDiff is null");
>> 117:         }
> 
> it's more common (and less surprising) to throw NPE in such cases, preferably by using `Objects::requireNonNull`

Haven't known about the `requireNonNull`, thanks. I was thinking about the NPE myself, just wanted to show up which
array was null. Fixed in the ba6e5411b4de5cf8b9230b7cdb7a518900eadc4b.

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

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


More information about the core-libs-dev mailing list