Skip to content

Commit ff54a6c

Browse files
committed
Remove unneeded source to map method
The source to map method which takes a decorator as an argument is always called with the NOOP variant. This is the default variant used when the method which does not take a parameter is called. Remove the needed method.
1 parent 6dd4d67 commit ff54a6c

File tree

3 files changed

+2
-11
lines changed

3 files changed

+2
-11
lines changed

server/src/main/java/org/elasticsearch/action/index/IndexRequest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import org.elasticsearch.index.mapper.MapperService;
4040
import org.elasticsearch.index.shard.ShardId;
4141
import org.elasticsearch.ingest.IngestService;
42-
import org.elasticsearch.plugins.internal.XContentParserDecorator;
4342
import org.elasticsearch.xcontent.XContentBuilder;
4443
import org.elasticsearch.xcontent.XContentFactory;
4544
import org.elasticsearch.xcontent.XContentType;
@@ -419,10 +418,6 @@ public Map<String, Object> sourceAsMap() {
419418
return XContentHelper.convertToMap(source, false, contentType).v2();
420419
}
421420

422-
public Map<String, Object> sourceAsMap(XContentParserDecorator parserDecorator) {
423-
return XContentHelper.convertToMap(source, false, contentType, parserDecorator).v2();
424-
}
425-
426421
/**
427422
* Index the Map in {@link Requests#INDEX_CONTENT_TYPE} format
428423
*

server/src/main/java/org/elasticsearch/action/update/UpdateHelper.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,7 @@ Result prepareUpdateIndexRequest(IndexShard indexShard, UpdateRequest request, G
193193
final XContentType updateSourceContentType = sourceAndContent.v1();
194194
final Map<String, Object> updatedSourceAsMap = sourceAndContent.v2();
195195

196-
final boolean noop = XContentHelper.update(
197-
updatedSourceAsMap,
198-
currentRequest.sourceAsMap(XContentParserDecorator.NOOP),
199-
detectNoop
200-
) == false;
196+
final boolean noop = XContentHelper.update(updatedSourceAsMap, currentRequest.sourceAsMap(), detectNoop) == false;
201197

202198
// We can only actually turn the update into a noop if detectNoop is true to preserve backwards compatibility and to handle cases
203199
// where users repopulating multi-fields or adding synonyms, etc.

server/src/main/java/org/elasticsearch/ingest/IngestService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,7 @@ private static IngestDocument newIngestDocument(final IndexRequest request) {
13451345
request.version(),
13461346
request.routing(),
13471347
request.versionType(),
1348-
request.sourceAsMap(XContentParserDecorator.NOOP)
1348+
request.sourceAsMap()
13491349
);
13501350
}
13511351

0 commit comments

Comments
 (0)