From 74c132afc622e9ebd56347c829eed284a5f83d3b Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Wed, 6 Jan 2016 21:00:27 -0500 Subject: [PATCH] Standardize some methods on varargs Right now we define the same sort of methods as taking String arrays and string varargs. We should standardize on one and varargs is easier to call so lets use varargs! --- .../main/java/org/elasticsearch/action/AliasesRequest.java | 2 +- .../main/java/org/elasticsearch/action/IndicesRequest.java | 6 +++--- .../action/admin/cluster/health/ClusterHealthRequest.java | 2 +- .../admin/indices/exists/indices/IndicesExistsRequest.java | 2 +- .../admin/indices/exists/types/TypesExistsRequest.java | 2 +- .../action/admin/indices/mapping/put/PutMappingRequest.java | 3 ++- .../action/admin/indices/warmer/put/PutWarmerRequest.java | 2 +- .../action/deletebyquery/DeleteByQueryRequest.java | 2 +- 8 files changed, 11 insertions(+), 10 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/action/AliasesRequest.java b/core/src/main/java/org/elasticsearch/action/AliasesRequest.java index 6e45af0cf84..a4ff57ebd20 100644 --- a/core/src/main/java/org/elasticsearch/action/AliasesRequest.java +++ b/core/src/main/java/org/elasticsearch/action/AliasesRequest.java @@ -35,7 +35,7 @@ public interface AliasesRequest extends IndicesRequest.Replaceable { /** * Sets the array of aliases that the action relates to */ - AliasesRequest aliases(String[] aliases); + AliasesRequest aliases(String... aliases); /** * Returns true if wildcards expressions among aliases should be resolved, false otherwise diff --git a/core/src/main/java/org/elasticsearch/action/IndicesRequest.java b/core/src/main/java/org/elasticsearch/action/IndicesRequest.java index 9200f99c6f7..4c62a7e849b 100644 --- a/core/src/main/java/org/elasticsearch/action/IndicesRequest.java +++ b/core/src/main/java/org/elasticsearch/action/IndicesRequest.java @@ -41,9 +41,9 @@ public interface IndicesRequest { IndicesOptions indicesOptions(); static interface Replaceable extends IndicesRequest { - /* - * Sets the array of indices that the action relates to + /** + * Sets the indices that the action relates to. */ - IndicesRequest indices(String[] indices); + IndicesRequest indices(String... indices); } } diff --git a/core/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthRequest.java b/core/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthRequest.java index d603886d924..59b426d8c31 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthRequest.java +++ b/core/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthRequest.java @@ -61,7 +61,7 @@ public class ClusterHealthRequest extends MasterNodeReadRequest im * Sets the indices this put mapping operation will execute on. */ @Override - public PutMappingRequest indices(String[] indices) { + public PutMappingRequest indices(String... indices) { this.indices = indices; return this; } diff --git a/core/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/PutWarmerRequest.java b/core/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/PutWarmerRequest.java index dbf136dec12..77f8f426876 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/PutWarmerRequest.java +++ b/core/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/PutWarmerRequest.java @@ -111,7 +111,7 @@ public class PutWarmerRequest extends AcknowledgedRequest impl } @Override - public IndicesRequest indices(String[] indices) { + public IndicesRequest indices(String... indices) { if (searchRequest == null) { throw new IllegalStateException("unable to set indices, search request is null"); } diff --git a/plugins/delete-by-query/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryRequest.java b/plugins/delete-by-query/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryRequest.java index fa83fb4fd3d..7103cf1a4e0 100644 --- a/plugins/delete-by-query/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryRequest.java +++ b/plugins/delete-by-query/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryRequest.java @@ -105,7 +105,7 @@ public class DeleteByQueryRequest extends ActionRequest im } @Override - public DeleteByQueryRequest indices(String[] indices) { + public DeleteByQueryRequest indices(String... indices) { this.indices = indices; return this; }