diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/scripted/ScriptedMetricAggregationBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/scripted/ScriptedMetricAggregationBuilder.java index ea246feda4d..2d6398ee31e 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/scripted/ScriptedMetricAggregationBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/scripted/ScriptedMetricAggregationBuilder.java @@ -37,10 +37,8 @@ import org.elasticsearch.search.aggregations.AggregatorFactory; import org.elasticsearch.search.internal.SearchContext; import java.io.IOException; -import java.util.HashSet; import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.function.Function; public class ScriptedMetricAggregationBuilder extends AbstractAggregationBuilder { @@ -239,11 +237,6 @@ public class ScriptedMetricAggregationBuilder extends AbstractAggregationBuilder Map params = null; XContentParser.Token token; String currentFieldName = null; - Set scriptParameters = new HashSet<>(); - scriptParameters.add(INIT_SCRIPT_FIELD.getPreferredName()); - scriptParameters.add(MAP_SCRIPT_FIELD.getPreferredName()); - scriptParameters.add(COMBINE_SCRIPT_FIELD.getPreferredName()); - scriptParameters.add(REDUCE_SCRIPT_FIELD.getPreferredName()); XContentParser parser = context.parser(); while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {