diff --git a/server/src/main/java/org/elasticsearch/ingest/IngestCtxMap.java b/server/src/main/java/org/elasticsearch/ingest/IngestCtxMap.java index b648051669567..e3cdc13e1c11e 100644 --- a/server/src/main/java/org/elasticsearch/ingest/IngestCtxMap.java +++ b/server/src/main/java/org/elasticsearch/ingest/IngestCtxMap.java @@ -13,7 +13,6 @@ import org.elasticsearch.script.Metadata; import java.time.ZonedDateTime; -import java.util.HashMap; import java.util.Map; /** @@ -32,7 +31,9 @@ class IngestCtxMap extends CtxMap { /** - * Create an IngestCtxMap with the given metadata, source and default validators + * Create an IngestCtxMap with the given metadata, source and default validators. + * + * Source is not copied, callers can observe changes to source. */ IngestCtxMap( String index, @@ -43,7 +44,7 @@ class IngestCtxMap extends CtxMap { ZonedDateTime timestamp, Map source ) { - super(new HashMap<>(source), new IngestDocMetadata(index, id, version, routing, versionType, timestamp)); + super(source, new IngestDocMetadata(index, id, version, routing, versionType, timestamp)); } /**