diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsResponse.java index 6a40cc779beb5..81afefbd43e09 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsResponse.java @@ -107,6 +107,8 @@ public GetSnapshotsResponse(Collection responses) { this.failedResponses.put(response.repository, response.error); } } + successfulResponses = Collections.unmodifiableMap(successfulResponses); + failedResponses = Collections.unmodifiableMap(failedResponses); } public GetSnapshotsResponse() { @@ -142,14 +144,14 @@ public Set getRepositories() { * Returns a map of repository name to the list of {@link SnapshotInfo} for each successful response. */ public Map> getSuccessfulResponses() { - return Map.copyOf(successfulResponses); + return successfulResponses; } /** * Returns a map of repository name to {@link ElasticsearchException} for each unsuccessful response. */ public Map getFailedResponses() { - return Map.copyOf(failedResponses); + return failedResponses; } /**