Skip to content

Commit 9cd83b2

Browse files
committed
Adding review comments
1 parent ea8779b commit 9cd83b2

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

core/src/main/java/org/elasticsearch/search/aggregations/ParsedAggregation.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ public final Map<String, Object> getMetaData() {
6363
//TODO it may make sense to move getType to the Aggregation interface given that we are duplicating it in both implementations
6464
protected abstract String getType();
6565

66-
//TODO the only way to avoid duplicating this method is making Aggregation extend ToXContent
67-
//and declare toXContent as a default method in it. Doesn't sound like the right thing to do.
6866
@Override
6967
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException {
7068
// Concatenates the type and the name of the aggregation (ex: top_hits#foo)

core/src/main/java/org/elasticsearch/search/aggregations/metrics/cardinality/ParsedCardinality.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import org.elasticsearch.common.xcontent.XContentBuilder;
2424
import org.elasticsearch.common.xcontent.XContentParser;
2525
import org.elasticsearch.search.DocValueFormat;
26-
import org.elasticsearch.search.aggregations.InternalAggregation.CommonFields;
2726
import org.elasticsearch.search.aggregations.ParsedAggregation;
2827

2928
import java.io.IOException;

core/src/test/java/org/elasticsearch/search/aggregations/metrics/cardinality/InternalCardinalityTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import java.util.List;
4545
import java.util.Map;
4646

47-
import static org.elasticsearch.common.xcontent.XContentHelper.toXContent;
4847
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertToXContentEquivalent;
4948

5049
public class InternalCardinalityTests extends InternalAggregationTestCase<InternalCardinality> {
@@ -93,8 +92,8 @@ public void testFromXContent() throws IOException {
9392
String name = cardinality.getName();
9493
ToXContent.Params params = new ToXContent.MapParams(Collections.singletonMap(RestSearchAction.TYPED_KEYS_PARAM, "true"));
9594
boolean humanReadable = randomBoolean();
96-
XContentType xContentType = XContentType.JSON; //randomFrom(XContentType.values());
97-
BytesReference originalBytes = toXContent(cardinality, xContentType, params, humanReadable);
95+
XContentType xContentType = randomFrom(XContentType.values());
96+
BytesReference originalBytes = toShuffledXContent(cardinality, xContentType, params, humanReadable);
9897
ParsedCardinality parsed;
9998
try (XContentParser parser = createParser(xContentType.xContent(), originalBytes)) {
10099
assertEquals(XContentParser.Token.START_OBJECT, parser.nextToken());

0 commit comments

Comments
 (0)