Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

package org.elasticsearch.search.aggregations.pipeline;

import com.carrotsearch.hppc.DoubleArrayList;

import org.elasticsearch.Version;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
Expand All @@ -18,7 +16,9 @@
import org.elasticsearch.xcontent.XContentParser;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;

Expand Down Expand Up @@ -152,11 +152,11 @@ protected PercentilesBucketPipelineAggregationBuilder buildFactory(
protected boolean token(XContentParser parser, String field, XContentParser.Token token, Map<String, Object> params)
throws IOException {
if (PERCENTS_FIELD.match(field, parser.getDeprecationHandler()) && token == XContentParser.Token.START_ARRAY) {
DoubleArrayList percents = new DoubleArrayList(10);
List<Double> percents = new ArrayList<>(10);
while (parser.nextToken() != XContentParser.Token.END_ARRAY) {
percents.add(parser.doubleValue());
}
params.put(PERCENTS_FIELD.getPreferredName(), percents.toArray());
params.put(PERCENTS_FIELD.getPreferredName(), percents.stream().mapToDouble(Double::doubleValue).toArray());
return true;
} else if (KEYED_FIELD.match(field, parser.getDeprecationHandler()) && token == XContentParser.Token.VALUE_BOOLEAN) {
params.put(KEYED_FIELD.getPreferredName(), parser.booleanValue());
Expand Down