RFR: JDK-8285504 Minor cleanup could be done in javax.net [v2]

Mark Powers duke at openjdk.java.net
Tue Apr 26 18:38:54 UTC 2022


On Tue, 26 Apr 2022 04:37:58 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> Mark Powers has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Alan Bateman comments
>
> src/java.base/share/classes/javax/net/ssl/KeyStoreBuilderParameters.java line 71:
> 
>> 69:         }
>> 70: 
>> 71:         this.parameters = List.copyOf(parameters);
> 
> Hello Mark, this would actually be a change in behaviour. The `List.copyOf` says:
> 
>> The given Collection must not be null and it must not contain any null elements.
> 
> The current implementation of the public constructor on the public `KeyStoreBuilderParameters` mandates no such requirement. So if there's some code which currently passes a list with a null element in it, then this change will now end up throwing a `NullPointerException` as per the contract of `List.copyOf`.

You are correct. This is not a good change since it changes behavior. Going back to the original. Thanks for your review!

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

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



More information about the security-dev mailing list