Correctly format arrays in output

There are a few places where arrays are output in messages yet the
output would merely use the default toString implementation rather than
actually putting the content of the array in the message. This commit
fixes the issue.

Relates #24340
This commit is contained in:
Koen De Groote 2017-06-09 17:45:07 +02:00 committed by Jason Tedor
parent 823cbb437b
commit 64888f6f01
3 changed files with 6 additions and 3 deletions

View File

@ -33,6 +33,7 @@ import org.elasticsearch.search.aggregations.support.ValuesSource;
import org.elasticsearch.search.internal.SearchContext; import org.elasticsearch.search.internal.SearchContext;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -114,7 +115,7 @@ public class SamplerAggregator extends SingleBucketAggregator {
return mode; return mode;
} }
} }
throw new IllegalArgumentException("Unknown `execution_hint`: [" + value + "], expected any of " + values()); throw new IllegalArgumentException("Unknown `execution_hint`: [" + value + "], expected any of " + Arrays.toString(values()));
} }
private final ParseField parseField; private final ParseField parseField;

View File

@ -53,6 +53,7 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig;
import org.elasticsearch.search.internal.SearchContext; import org.elasticsearch.search.internal.SearchContext;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -327,7 +328,7 @@ public class SignificantTermsAggregatorFactory extends ValuesSourceAggregatorFac
return mode; return mode;
} }
} }
throw new IllegalArgumentException("Unknown `execution_hint`: [" + value + "], expected any of " + values()); throw new IllegalArgumentException("Unknown `execution_hint`: [" + value + "], expected any of " + Arrays.toString(values()));
} }
private final ParseField parseField; private final ParseField parseField;

View File

@ -41,6 +41,7 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig;
import org.elasticsearch.search.internal.SearchContext; import org.elasticsearch.search.internal.SearchContext;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -359,7 +360,7 @@ public class TermsAggregatorFactory extends ValuesSourceAggregatorFactory<Values
return mode; return mode;
} }
} }
throw new IllegalArgumentException("Unknown `execution_hint`: [" + value + "], expected any of " + values()); throw new IllegalArgumentException("Unknown `execution_hint`: [" + value + "], expected any of " + Arrays.toString(values()));
} }
private final ParseField parseField; private final ParseField parseField;