From d3dff6659b93df836268bf13a26be18b076365f0 Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Tue, 30 Aug 2016 10:10:08 +0200 Subject: [PATCH] Returns empty set of filters in MonitoringIndexNameResolver and fix tests Original commit: elastic/x-pack-elasticsearch@e901347de9accf18c5267955badbf76d97a14b43 --- .../agent/resolver/MonitoringIndexNameResolver.java | 5 +++-- .../agent/resolver/MonitoringIndexNameResolverTestCase.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/MonitoringIndexNameResolver.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/MonitoringIndexNameResolver.java index 6b1cd237e8e..805531549b2 100644 --- a/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/MonitoringIndexNameResolver.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/MonitoringIndexNameResolver.java @@ -23,6 +23,7 @@ import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; import java.io.IOException; +import java.util.Collections; import java.util.Locale; import java.util.Set; import java.util.function.Function; @@ -108,11 +109,11 @@ public abstract class MonitoringIndexNameResolver { /** * @return the filters used when rendering the document. - * If null or empty, no filtering is applied. + * If empty, no filtering is applied. */ public Set filters() { // No filtering by default - return null; + return Collections.emptySet(); } protected abstract void buildXContent(T document, XContentBuilder builder, ToXContent.Params params) throws IOException; diff --git a/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/MonitoringIndexNameResolverTestCase.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/MonitoringIndexNameResolverTestCase.java index 2a8d0961ab9..d6826919367 100644 --- a/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/MonitoringIndexNameResolverTestCase.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/MonitoringIndexNameResolverTestCase.java @@ -161,7 +161,7 @@ public abstract class MonitoringIndexNameResolverTestCase