mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -202,9 +202,7 @@ public class PolicyParser {
|
|||
DomainEntry de = parseDomainEntry();
|
||||
if (de != null) {
|
||||
String domainName = de.getName();
|
||||
if (!domainEntries.containsKey(domainName)) {
|
||||
domainEntries.put(domainName, de);
|
||||
} else {
|
||||
if (domainEntries.putIfAbsent(domainName, de) != null) {
|
||||
LocalizedMessage localizedMsg = new LocalizedMessage(
|
||||
"duplicate.keystore.domain.name");
|
||||
Object[] source = {domainName};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue