mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8288329: Avoid redundant TreeMap.containsKey call in PolicyParser.read
Reviewed-by: mullan
This commit is contained in:
parent
f62b2bd9cd
commit
7acdcc1034
1 changed files with 2 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -202,9 +202,7 @@ public class PolicyParser {
|
||||||
DomainEntry de = parseDomainEntry();
|
DomainEntry de = parseDomainEntry();
|
||||||
if (de != null) {
|
if (de != null) {
|
||||||
String domainName = de.getName();
|
String domainName = de.getName();
|
||||||
if (!domainEntries.containsKey(domainName)) {
|
if (domainEntries.putIfAbsent(domainName, de) != null) {
|
||||||
domainEntries.put(domainName, de);
|
|
||||||
} else {
|
|
||||||
LocalizedMessage localizedMsg = new LocalizedMessage(
|
LocalizedMessage localizedMsg = new LocalizedMessage(
|
||||||
"duplicate.keystore.domain.name");
|
"duplicate.keystore.domain.name");
|
||||||
Object[] source = {domainName};
|
Object[] source = {domainName};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue