Skip to content

Commit 8565746

Browse files
committed
unmodifiable map add
Signed-off-by: TJ Neuenfeldt <tjneu@amazon.com>
1 parent 4be314f commit 8565746

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/src/main/java/org/opensearch/search/profile/AbstractProfileBreakdown.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
package org.opensearch.search.profile;
3434

3535
import java.util.Collection;
36+
import java.util.Collections;
3637
import java.util.Map;
3738
import java.util.TreeMap;
3839
import java.util.function.Supplier;
@@ -74,7 +75,7 @@ public Map<String, Long> toBreakdownMap() {
7475
for (Map.Entry<String, ProfileMetric> entry : metrics.entrySet()) {
7576
map.putAll(entry.getValue().toBreakdownMap());
7677
}
77-
return map;
78+
return Collections.unmodifiableMap(map);
7879
}
7980

8081
public long toNodeTime() {

0 commit comments

Comments
 (0)