diff --git a/core/src/main/java/org/elasticsearch/common/collect/MapBuilder.java b/core/src/main/java/org/elasticsearch/common/collect/MapBuilder.java index 290efb2a1a6..1ca305bc6ba 100644 --- a/core/src/main/java/org/elasticsearch/common/collect/MapBuilder.java +++ b/core/src/main/java/org/elasticsearch/common/collect/MapBuilder.java @@ -83,6 +83,13 @@ public class MapBuilder { return this.map; } + /** + * Build an immutable copy of the map under construction. + * + * @deprecated always copies the map under construction. prefer building a + * HashMap by hand and wrapping it in an unmodifiableMap + */ + @Deprecated public ImmutableMap immutableMap() { // Note that this whole method is going to have to go next but we're changing it like this here just to keep the commit smaller. return ImmutableMap.builder().putAll(map).build();