From 31d274727a40dfed35fff7eded126c69a82f113e Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Mon, 8 Jan 2024 18:02:44 +0100 Subject: [PATCH] Nit --- .../transport/RemoteClusterCredentialsManager.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/transport/RemoteClusterCredentialsManager.java b/server/src/main/java/org/elasticsearch/transport/RemoteClusterCredentialsManager.java index bc2e3ade7440f..7a6df38addba8 100644 --- a/server/src/main/java/org/elasticsearch/transport/RemoteClusterCredentialsManager.java +++ b/server/src/main/java/org/elasticsearch/transport/RemoteClusterCredentialsManager.java @@ -19,7 +19,6 @@ import java.util.Collections; import java.util.Map; import java.util.Set; -import java.util.TreeSet; import static org.elasticsearch.transport.RemoteClusterService.REMOTE_CLUSTER_CREDENTIALS; @@ -37,7 +36,7 @@ public final synchronized UpdateRemoteClusterCredentialsResult updateClusterCred final Map newClusterCredentials = REMOTE_CLUSTER_CREDENTIALS.getAsMap(settings); if (clusterCredentials.isEmpty()) { setClusterCredentialsAndLog(newClusterCredentials); - return new UpdateRemoteClusterCredentialsResult(new TreeSet<>(newClusterCredentials.keySet()), Collections.emptySortedSet()); + return new UpdateRemoteClusterCredentialsResult(Set.copyOf(newClusterCredentials.keySet()), Collections.emptySet()); } final Set addedClusterAliases = Sets.difference(newClusterCredentials.keySet(), clusterCredentials.keySet());