On Fri, 26 Aug 2022 17:46:44 GMT, Valerie Peng <valer...@openjdk.org> wrote:

>> Right, but in this case I think if an NPE is ever thrown it would be 
>> considered a bug in the JDK because an unexpected RuntimeException would be 
>> thrown. I think requireNonNull is used more in cases where caller input is 
>> being validated and null is not valid. I find this code less readable. There 
>> are lots of cases in the JDK code where some object could theoretically be 
>> null, but it would be a bug if it was. If it was a normal case for a 
>> provider to sometimes be null here, then I would expect this code to check 
>> for null and handle it.
>> 
>> @valeriep is more familiar with this code, so I would also like her feedback 
>> on these changes to use requireNonNull.
>
> I don't see much benefit of using Objects.requireNonNull() here also for the 
> reasons that Sean have already stated.

@valeriepeng agrees with you Sean. I'll remove `requireNonNull` here and 
elsewhere unless there is a compelling reason to keep it.

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

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

Reply via email to