Skip to content

Commit

Permalink
Use unmodifiableMap in the constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Ershov committed May 23, 2019
1 parent c00640f commit 3963638
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ public GetSnapshotsResponse(Collection<Response> responses) {
this.failedResponses.put(response.repository, response.error);
}
}
successfulResponses = Collections.unmodifiableMap(successfulResponses);
failedResponses = Collections.unmodifiableMap(failedResponses);
}

public GetSnapshotsResponse() {
Expand Down Expand Up @@ -142,14 +144,14 @@ public Set<String> getRepositories() {
* Returns a map of repository name to the list of {@link SnapshotInfo} for each successful response.
*/
public Map<String, List<SnapshotInfo>> getSuccessfulResponses() {
return Map.copyOf(successfulResponses);
return successfulResponses;
}

/**
* Returns a map of repository name to {@link ElasticsearchException} for each unsuccessful response.
*/
public Map<String, ElasticsearchException> getFailedResponses() {
return Map.copyOf(failedResponses);
return failedResponses;
}

/**
Expand Down

0 comments on commit 3963638

Please sign in to comment.