On Sat, 30 Apr 2022 10:17:43 GMT, Andrey Turbanov <aturba...@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. This pull request has now been integrated. Changeset: 4caf1ef3 Author: Andrey Turbanov <aturba...@openjdk.org> URL: https://git.openjdk.java.net/jdk/commit/4caf1ef389fd02bf53a9b7ed33d3b57fdaa79bd2 Stats: 12 lines in 1 file changed: 0 ins; 6 del; 6 mod 8287390: Cleanup Map usage in AuthenticationInfo.requestAuthentication Reviewed-by: dfuchs, jpai ------------- PR: https://git.openjdk.java.net/jdk/pull/8484