Skip to content

Commit

Permalink
Don't copy source
Browse files Browse the repository at this point in the history
  • Loading branch information
stu-elastic committed Jul 13, 2022
1 parent dc1fc58 commit a08afb8
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.elasticsearch.script.Metadata;

import java.time.ZonedDateTime;
import java.util.HashMap;
import java.util.Map;

/**
Expand All @@ -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,
Expand All @@ -43,7 +44,7 @@ class IngestCtxMap extends CtxMap {
ZonedDateTime timestamp,
Map<String, Object> source
) {
super(new HashMap<>(source), new IngestDocMetadata(index, id, version, routing, versionType, timestamp));
super(source, new IngestDocMetadata(index, id, version, routing, versionType, timestamp));
}

/**
Expand Down

0 comments on commit a08afb8

Please sign in to comment.