RFR: 8287390: Cleanup Map usage in AuthenticationInfo.requestAuthentication [v2]

Jaikiran Pai jpai at openjdk.java.net
Wed Jun 1 13:35:43 UTC 2022


On Wed, 1 Jun 2022 13:32:28 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

>> `AuthenticationInfo.requestAuthentication` uses separate `HashMap`'s `get` +`put` calls.
>> 
>> https://github.com/openjdk/jdk/blob/176bb23de18d9ab448e77e85a9c965a7c02f2c50/src/java.base/share/classes/sun/net/www/protocol/http/AuthenticationInfo.java#L155-L165
>> 
>> Instead we can use the `HashMap.putIfAbsent` to make code a bit easier to follow. We know that `requests` can contain only non-null values.
>
> Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8287390: Cleanup Map usage in AuthenticationInfo.requestAuthentication
>   remove obvious assert

Marked as reviewed by jpai (Reviewer).

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

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


More information about the net-dev mailing list