From b8659fcb83f7f2db4dbb85428a0654ae31b7fdec Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Mon, 4 Mar 2019 13:26:43 +0100 Subject: [PATCH] No need to extend from StatusToXContentObject, if RestToXContentListener is used instead of RestStatusToXContentListener --- .../ingest/common/GrokProcessorGetAction.java | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GrokProcessorGetAction.java b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GrokProcessorGetAction.java index 68d037aa9de..1141a4cf7e8 100644 --- a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GrokProcessorGetAction.java +++ b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GrokProcessorGetAction.java @@ -30,13 +30,12 @@ import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.StatusToXContentObject; +import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestRequest; -import org.elasticsearch.rest.RestStatus; -import org.elasticsearch.rest.action.RestStatusToXContentListener; +import org.elasticsearch.rest.action.RestToXContentListener; import org.elasticsearch.tasks.Task; import org.elasticsearch.transport.TransportService; @@ -45,7 +44,6 @@ import java.util.Map; import static org.elasticsearch.ingest.common.IngestCommonPlugin.GROK_PATTERNS; import static org.elasticsearch.rest.RestRequest.Method.GET; -import static org.elasticsearch.rest.RestStatus.OK; public class GrokProcessorGetAction extends Action { @@ -68,7 +66,7 @@ public class GrokProcessorGetAction extends Action grokPatterns; Response(Map grokPatterns) { @@ -88,11 +86,6 @@ public class GrokProcessorGetAction extends Action client.executeLocally(INSTANCE, new Request(), new RestStatusToXContentListener<>(channel)); + return channel -> client.executeLocally(INSTANCE, new Request(), new RestToXContentListener<>(channel)); } } }