From 7b3f9adffd05e1e7586b725d16c1198bf777b96a Mon Sep 17 00:00:00 2001 From: nitram509 Date: Sun, 12 Jul 2015 12:30:19 +0200 Subject: [PATCH] replaced StringBuild with String concatenation, as suggested by IntelliJ (IntelliJ code inspection, cite: "Reports any variables declared as or uses of java.lang.StringBuffer and java.lang.StringBuilder which can be replaced with a single java.lang.String concatenation. Using a String concatenation makes the code shorter and simpler. This inspection only reports when the resulting concatenation is at least as efficient or more efficient than the original StringBuffer or StringBuilder use.") --- .../src/main/java/io/searchbox/cluster/GetSettings.java | 4 +--- .../src/main/java/io/searchbox/cluster/Health.java | 4 +--- .../main/java/io/searchbox/cluster/NodesHotThreads.java | 8 +++----- .../src/main/java/io/searchbox/cluster/NodesInfo.java | 4 +--- .../src/main/java/io/searchbox/cluster/NodesShutdown.java | 8 +++----- .../src/main/java/io/searchbox/cluster/NodesStats.java | 8 +++----- jest-common/src/main/java/io/searchbox/cluster/State.java | 4 +--- .../main/java/io/searchbox/cluster/UpdateSettings.java | 4 +--- jest-common/src/main/java/io/searchbox/core/Bulk.java | 4 +--- jest-common/src/main/java/io/searchbox/core/Count.java | 4 +--- .../src/main/java/io/searchbox/core/DeleteByQuery.java | 4 +--- jest-common/src/main/java/io/searchbox/core/Explain.java | 4 +--- .../src/main/java/io/searchbox/core/MoreLikeThis.java | 4 +--- jest-common/src/main/java/io/searchbox/core/MultiGet.java | 4 +--- .../src/main/java/io/searchbox/core/MultiSearch.java | 4 +--- .../src/main/java/io/searchbox/core/Percolate.java | 4 +--- jest-common/src/main/java/io/searchbox/core/Search.java | 4 +--- .../src/main/java/io/searchbox/core/SearchScroll.java | 4 +--- .../src/main/java/io/searchbox/core/SearchShards.java | 4 +--- jest-common/src/main/java/io/searchbox/core/Suggest.java | 4 +--- jest-common/src/main/java/io/searchbox/core/Update.java | 4 +--- jest-common/src/main/java/io/searchbox/core/Validate.java | 4 +--- .../src/main/java/io/searchbox/indices/Analyze.java | 4 +--- .../src/main/java/io/searchbox/indices/ClearCache.java | 4 +--- .../src/main/java/io/searchbox/indices/CloseIndex.java | 4 +--- jest-common/src/main/java/io/searchbox/indices/Flush.java | 4 +--- .../src/main/java/io/searchbox/indices/OpenIndex.java | 4 +--- .../src/main/java/io/searchbox/indices/Optimize.java | 4 +--- .../src/main/java/io/searchbox/indices/Refresh.java | 4 +--- jest-common/src/main/java/io/searchbox/indices/Stats.java | 4 +--- .../src/main/java/io/searchbox/indices/Status.java | 4 +--- .../java/io/searchbox/indices/aliases/GetAliases.java | 4 +--- .../java/io/searchbox/indices/aliases/ModifyAliases.java | 4 +--- .../java/io/searchbox/indices/mapping/DeleteMapping.java | 4 +--- .../java/io/searchbox/indices/mapping/GetMapping.java | 4 +--- .../java/io/searchbox/indices/mapping/PutMapping.java | 4 +--- .../indices/settings/IndicesSettingsAbstractAction.java | 4 +--- 37 files changed, 43 insertions(+), 117 deletions(-) diff --git a/jest-common/src/main/java/io/searchbox/cluster/GetSettings.java b/jest-common/src/main/java/io/searchbox/cluster/GetSettings.java index 12c664b56..c3d569ad9 100644 --- a/jest-common/src/main/java/io/searchbox/cluster/GetSettings.java +++ b/jest-common/src/main/java/io/searchbox/cluster/GetSettings.java @@ -16,9 +16,7 @@ protected GetSettings(Builder builder) { } protected String buildURI() { - StringBuilder sb = new StringBuilder(super.buildURI()); - sb.append("/_cluster/settings"); - return sb.toString(); + return super.buildURI() + "/_cluster/settings"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/cluster/Health.java b/jest-common/src/main/java/io/searchbox/cluster/Health.java index b13d2fd9a..7176f38f1 100644 --- a/jest-common/src/main/java/io/searchbox/cluster/Health.java +++ b/jest-common/src/main/java/io/searchbox/cluster/Health.java @@ -16,9 +16,7 @@ protected Health(Builder builder) { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(super.buildURI()); - sb.append("/_cluster/health/"); - return sb.toString(); + return super.buildURI() + "/_cluster/health/"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/cluster/NodesHotThreads.java b/jest-common/src/main/java/io/searchbox/cluster/NodesHotThreads.java index fb0b2ac15..f6c894650 100644 --- a/jest-common/src/main/java/io/searchbox/cluster/NodesHotThreads.java +++ b/jest-common/src/main/java/io/searchbox/cluster/NodesHotThreads.java @@ -20,11 +20,9 @@ protected NodesHotThreads(Builder builder) { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(super.buildURI()); - sb.append("/_nodes/") - .append(nodes) - .append("/hot_threads"); - return sb.toString(); + return super.buildURI() + "/_nodes/" + + nodes + + "/hot_threads"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/cluster/NodesInfo.java b/jest-common/src/main/java/io/searchbox/cluster/NodesInfo.java index b08cd7117..00ca6470e 100644 --- a/jest-common/src/main/java/io/searchbox/cluster/NodesInfo.java +++ b/jest-common/src/main/java/io/searchbox/cluster/NodesInfo.java @@ -16,9 +16,7 @@ protected NodesInfo(Builder builder) { } protected String buildURI() { - StringBuilder sb = new StringBuilder(super.buildURI()); - sb.append("/_nodes").append("/").append(nodes); - return sb.toString(); + return super.buildURI() + "/_nodes/" + nodes; } @Override diff --git a/jest-common/src/main/java/io/searchbox/cluster/NodesShutdown.java b/jest-common/src/main/java/io/searchbox/cluster/NodesShutdown.java index 83febd735..20ebc9ee4 100644 --- a/jest-common/src/main/java/io/searchbox/cluster/NodesShutdown.java +++ b/jest-common/src/main/java/io/searchbox/cluster/NodesShutdown.java @@ -17,11 +17,9 @@ protected NodesShutdown(Builder builder) { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(super.buildURI()); - sb.append("/_nodes/") - .append(nodes) - .append("/_shutdown"); - return sb.toString(); + return super.buildURI() + "/_nodes/" + + nodes + + "/_shutdown"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/cluster/NodesStats.java b/jest-common/src/main/java/io/searchbox/cluster/NodesStats.java index 3460b9e84..f8c377174 100644 --- a/jest-common/src/main/java/io/searchbox/cluster/NodesStats.java +++ b/jest-common/src/main/java/io/searchbox/cluster/NodesStats.java @@ -17,11 +17,9 @@ protected NodesStats(Builder builder) { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(super.buildURI()); - sb.append("/_nodes/") - .append(nodes) - .append("/stats"); - return sb.toString(); + return super.buildURI() + "/_nodes/" + + nodes + + "/stats"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/cluster/State.java b/jest-common/src/main/java/io/searchbox/cluster/State.java index 07feae3c2..2af30e49d 100644 --- a/jest-common/src/main/java/io/searchbox/cluster/State.java +++ b/jest-common/src/main/java/io/searchbox/cluster/State.java @@ -16,9 +16,7 @@ protected State(Builder builder) { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(super.buildURI()); - sb.append("/_cluster/state"); - return sb.toString(); + return super.buildURI() + "/_cluster/state"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/cluster/UpdateSettings.java b/jest-common/src/main/java/io/searchbox/cluster/UpdateSettings.java index 4fbbc6a64..a1fae3fd0 100644 --- a/jest-common/src/main/java/io/searchbox/cluster/UpdateSettings.java +++ b/jest-common/src/main/java/io/searchbox/cluster/UpdateSettings.java @@ -25,9 +25,7 @@ protected UpdateSettings(Builder builder) { } protected String buildURI() { - StringBuilder sb = new StringBuilder(super.buildURI()); - sb.append("/_cluster/settings"); - return sb.toString(); + return super.buildURI() + "/_cluster/settings"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/core/Bulk.java b/jest-common/src/main/java/io/searchbox/core/Bulk.java index 96f5d4bbc..ae4b6a80f 100644 --- a/jest-common/src/main/java/io/searchbox/core/Bulk.java +++ b/jest-common/src/main/java/io/searchbox/core/Bulk.java @@ -117,9 +117,7 @@ public String getPathToResult() { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(super.buildURI()); - sb.append("/_bulk"); - return sb.toString(); + return super.buildURI() + "/_bulk"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/core/Count.java b/jest-common/src/main/java/io/searchbox/core/Count.java index 03e95e6d8..8d5832f6a 100644 --- a/jest-common/src/main/java/io/searchbox/core/Count.java +++ b/jest-common/src/main/java/io/searchbox/core/Count.java @@ -21,9 +21,7 @@ protected Count(Builder builder) { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_count"); - return sb.toString(); + return super.buildURI() + "/_count"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/core/DeleteByQuery.java b/jest-common/src/main/java/io/searchbox/core/DeleteByQuery.java index 6815bda07..e0c7a922f 100644 --- a/jest-common/src/main/java/io/searchbox/core/DeleteByQuery.java +++ b/jest-common/src/main/java/io/searchbox/core/DeleteByQuery.java @@ -20,9 +20,7 @@ protected DeleteByQuery(Builder builder) { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_query"); - return sb.toString(); + return super.buildURI() + "/_query"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/core/Explain.java b/jest-common/src/main/java/io/searchbox/core/Explain.java index b25788791..419e15080 100644 --- a/jest-common/src/main/java/io/searchbox/core/Explain.java +++ b/jest-common/src/main/java/io/searchbox/core/Explain.java @@ -23,9 +23,7 @@ public String getRestMethodName() { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(super.buildURI()); - sb.append("/_explain"); - return sb.toString(); + return super.buildURI() + "/_explain"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/core/MoreLikeThis.java b/jest-common/src/main/java/io/searchbox/core/MoreLikeThis.java index 209ac1971..f99d6733b 100644 --- a/jest-common/src/main/java/io/searchbox/core/MoreLikeThis.java +++ b/jest-common/src/main/java/io/searchbox/core/MoreLikeThis.java @@ -19,9 +19,7 @@ protected MoreLikeThis(Builder builder) { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(super.buildURI()); - sb.append("/_mlt"); - return sb.toString(); + return super.buildURI() + "/_mlt"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/core/MultiGet.java b/jest-common/src/main/java/io/searchbox/core/MultiGet.java index 1074900a9..ee7790580 100644 --- a/jest-common/src/main/java/io/searchbox/core/MultiGet.java +++ b/jest-common/src/main/java/io/searchbox/core/MultiGet.java @@ -46,9 +46,7 @@ public Object apply(Doc doc) { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_mget"); - return sb.toString(); + return super.buildURI() + "/_mget"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/core/MultiSearch.java b/jest-common/src/main/java/io/searchbox/core/MultiSearch.java index 72c1a9b98..19de44eb7 100644 --- a/jest-common/src/main/java/io/searchbox/core/MultiSearch.java +++ b/jest-common/src/main/java/io/searchbox/core/MultiSearch.java @@ -55,9 +55,7 @@ public String getData(Gson gson) { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_msearch"); - return sb.toString(); + return super.buildURI() + "/_msearch"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/core/Percolate.java b/jest-common/src/main/java/io/searchbox/core/Percolate.java index a647aacb4..eaa0b5598 100644 --- a/jest-common/src/main/java/io/searchbox/core/Percolate.java +++ b/jest-common/src/main/java/io/searchbox/core/Percolate.java @@ -28,9 +28,7 @@ public String getRestMethodName() { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_percolate"); - return sb.toString(); + return super.buildURI() + "/_percolate"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/core/Search.java b/jest-common/src/main/java/io/searchbox/core/Search.java index 4afeea4e2..9b2cae6cb 100644 --- a/jest-common/src/main/java/io/searchbox/core/Search.java +++ b/jest-common/src/main/java/io/searchbox/core/Search.java @@ -43,9 +43,7 @@ public String getType() { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_search"); - return sb.toString(); + return super.buildURI() + "/_search"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/core/SearchScroll.java b/jest-common/src/main/java/io/searchbox/core/SearchScroll.java index bee21d3cc..d039b2d93 100644 --- a/jest-common/src/main/java/io/searchbox/core/SearchScroll.java +++ b/jest-common/src/main/java/io/searchbox/core/SearchScroll.java @@ -30,9 +30,7 @@ protected SearchScroll(Builder builder) { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_search/scroll"); - return sb.toString(); + return super.buildURI() + "/_search/scroll"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/core/SearchShards.java b/jest-common/src/main/java/io/searchbox/core/SearchShards.java index 2c139756a..7799714c2 100644 --- a/jest-common/src/main/java/io/searchbox/core/SearchShards.java +++ b/jest-common/src/main/java/io/searchbox/core/SearchShards.java @@ -18,9 +18,7 @@ protected SearchShards(Builder builder) { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_search_shards"); - return sb.toString(); + return super.buildURI() + "/_search_shards"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/core/Suggest.java b/jest-common/src/main/java/io/searchbox/core/Suggest.java index e00e6bd2e..b977cd1ed 100644 --- a/jest-common/src/main/java/io/searchbox/core/Suggest.java +++ b/jest-common/src/main/java/io/searchbox/core/Suggest.java @@ -35,9 +35,7 @@ public String getType() { @Override protected String buildURI() { - final StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_suggest"); - return sb.toString(); + return super.buildURI() + "/_suggest"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/core/Update.java b/jest-common/src/main/java/io/searchbox/core/Update.java index 412a5a418..52d795dd2 100644 --- a/jest-common/src/main/java/io/searchbox/core/Update.java +++ b/jest-common/src/main/java/io/searchbox/core/Update.java @@ -26,9 +26,7 @@ public String getBulkMethodName() { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(super.buildURI()); - sb.append("/_update"); - return sb.toString(); + return super.buildURI() + "/_update"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/core/Validate.java b/jest-common/src/main/java/io/searchbox/core/Validate.java index bb4a15be1..94bcd6b5e 100644 --- a/jest-common/src/main/java/io/searchbox/core/Validate.java +++ b/jest-common/src/main/java/io/searchbox/core/Validate.java @@ -21,9 +21,7 @@ protected Validate(Builder builder) { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(super.buildURI()); - sb.append("/_validate/query"); - return sb.toString(); + return super.buildURI() + "/_validate/query"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/indices/Analyze.java b/jest-common/src/main/java/io/searchbox/indices/Analyze.java index b9c7cdd42..f135316d4 100644 --- a/jest-common/src/main/java/io/searchbox/indices/Analyze.java +++ b/jest-common/src/main/java/io/searchbox/indices/Analyze.java @@ -23,9 +23,7 @@ protected Analyze(Builder builder) { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_analyze"); - return sb.toString(); + return super.buildURI() + "/_analyze"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/indices/ClearCache.java b/jest-common/src/main/java/io/searchbox/indices/ClearCache.java index b6d0ef42b..34f5f886b 100644 --- a/jest-common/src/main/java/io/searchbox/indices/ClearCache.java +++ b/jest-common/src/main/java/io/searchbox/indices/ClearCache.java @@ -16,9 +16,7 @@ protected ClearCache(Builder builder) { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_cache/clear"); - return sb.toString(); + return super.buildURI() + "/_cache/clear"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/indices/CloseIndex.java b/jest-common/src/main/java/io/searchbox/indices/CloseIndex.java index 67d7c5fd0..062207090 100644 --- a/jest-common/src/main/java/io/searchbox/indices/CloseIndex.java +++ b/jest-common/src/main/java/io/searchbox/indices/CloseIndex.java @@ -16,9 +16,7 @@ protected CloseIndex(Builder builder) { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_close"); - return sb.toString(); + return super.buildURI() + "/_close"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/indices/Flush.java b/jest-common/src/main/java/io/searchbox/indices/Flush.java index 69f31930a..a4561fce7 100644 --- a/jest-common/src/main/java/io/searchbox/indices/Flush.java +++ b/jest-common/src/main/java/io/searchbox/indices/Flush.java @@ -16,9 +16,7 @@ protected Flush(Builder builder) { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_flush"); - return sb.toString(); + return super.buildURI() + "/_flush"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/indices/OpenIndex.java b/jest-common/src/main/java/io/searchbox/indices/OpenIndex.java index ca6457496..a4b57d734 100644 --- a/jest-common/src/main/java/io/searchbox/indices/OpenIndex.java +++ b/jest-common/src/main/java/io/searchbox/indices/OpenIndex.java @@ -15,9 +15,7 @@ protected OpenIndex(Builder builder) { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_open"); - return sb.toString(); + return super.buildURI() + "/_open"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/indices/Optimize.java b/jest-common/src/main/java/io/searchbox/indices/Optimize.java index c0abe9e9c..2c2550015 100644 --- a/jest-common/src/main/java/io/searchbox/indices/Optimize.java +++ b/jest-common/src/main/java/io/searchbox/indices/Optimize.java @@ -21,9 +21,7 @@ public String getRestMethodName() { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_optimize"); - return sb.toString(); + return super.buildURI() + "/_optimize"; } public static class Builder extends AbstractMultiIndexActionBuilder { diff --git a/jest-common/src/main/java/io/searchbox/indices/Refresh.java b/jest-common/src/main/java/io/searchbox/indices/Refresh.java index c3796376e..ab57e77c5 100644 --- a/jest-common/src/main/java/io/searchbox/indices/Refresh.java +++ b/jest-common/src/main/java/io/searchbox/indices/Refresh.java @@ -21,9 +21,7 @@ public String getRestMethodName() { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_refresh"); - return sb.toString(); + return super.buildURI() + "/_refresh"; } public static class Builder extends AbstractMultiIndexActionBuilder { diff --git a/jest-common/src/main/java/io/searchbox/indices/Stats.java b/jest-common/src/main/java/io/searchbox/indices/Stats.java index 78ce4fd72..2e350c2f6 100644 --- a/jest-common/src/main/java/io/searchbox/indices/Stats.java +++ b/jest-common/src/main/java/io/searchbox/indices/Stats.java @@ -25,9 +25,7 @@ public String getRestMethodName() { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_stats"); - return sb.toString(); + return super.buildURI() + "/_stats"; } public static class Builder extends AbstractMultiIndexActionBuilder { diff --git a/jest-common/src/main/java/io/searchbox/indices/Status.java b/jest-common/src/main/java/io/searchbox/indices/Status.java index 5121ec04c..0d5b969d4 100644 --- a/jest-common/src/main/java/io/searchbox/indices/Status.java +++ b/jest-common/src/main/java/io/searchbox/indices/Status.java @@ -22,9 +22,7 @@ public String getRestMethodName() { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_status"); - return sb.toString(); + return super.buildURI() + "/_status"; } public static class Builder extends AbstractMultiIndexActionBuilder { diff --git a/jest-common/src/main/java/io/searchbox/indices/aliases/GetAliases.java b/jest-common/src/main/java/io/searchbox/indices/aliases/GetAliases.java index 78b05fcc4..29b2cf8fb 100644 --- a/jest-common/src/main/java/io/searchbox/indices/aliases/GetAliases.java +++ b/jest-common/src/main/java/io/searchbox/indices/aliases/GetAliases.java @@ -20,9 +20,7 @@ public String getRestMethodName() { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_aliases"); - return sb.toString(); + return super.buildURI() + "/_aliases"; } public static class Builder extends AbstractMultiIndexActionBuilder { diff --git a/jest-common/src/main/java/io/searchbox/indices/aliases/ModifyAliases.java b/jest-common/src/main/java/io/searchbox/indices/aliases/ModifyAliases.java index 1c1e90511..8001bebbc 100644 --- a/jest-common/src/main/java/io/searchbox/indices/aliases/ModifyAliases.java +++ b/jest-common/src/main/java/io/searchbox/indices/aliases/ModifyAliases.java @@ -28,9 +28,7 @@ protected ModifyAliases(Builder builder) { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_aliases"); - return sb.toString(); + return super.buildURI() + "/_aliases"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/indices/mapping/DeleteMapping.java b/jest-common/src/main/java/io/searchbox/indices/mapping/DeleteMapping.java index 7869f9851..baad25a35 100644 --- a/jest-common/src/main/java/io/searchbox/indices/mapping/DeleteMapping.java +++ b/jest-common/src/main/java/io/searchbox/indices/mapping/DeleteMapping.java @@ -19,9 +19,7 @@ protected DeleteMapping(Builder builder) { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_mapping"); - return sb.toString(); + return super.buildURI() + "/_mapping"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/indices/mapping/GetMapping.java b/jest-common/src/main/java/io/searchbox/indices/mapping/GetMapping.java index a3a297561..59db4f9db 100644 --- a/jest-common/src/main/java/io/searchbox/indices/mapping/GetMapping.java +++ b/jest-common/src/main/java/io/searchbox/indices/mapping/GetMapping.java @@ -21,9 +21,7 @@ public String getRestMethodName() { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_mapping"); - return sb.toString(); + return super.buildURI() + "/_mapping"; } public static class Builder extends AbstractMultiTypeActionBuilder { diff --git a/jest-common/src/main/java/io/searchbox/indices/mapping/PutMapping.java b/jest-common/src/main/java/io/searchbox/indices/mapping/PutMapping.java index 7d2d980c7..89580bf42 100644 --- a/jest-common/src/main/java/io/searchbox/indices/mapping/PutMapping.java +++ b/jest-common/src/main/java/io/searchbox/indices/mapping/PutMapping.java @@ -21,9 +21,7 @@ protected PutMapping(Builder builder) { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_mapping"); - return sb.toString(); + return super.buildURI() + "/_mapping"; } @Override diff --git a/jest-common/src/main/java/io/searchbox/indices/settings/IndicesSettingsAbstractAction.java b/jest-common/src/main/java/io/searchbox/indices/settings/IndicesSettingsAbstractAction.java index 6701f27c2..d9a024ed5 100644 --- a/jest-common/src/main/java/io/searchbox/indices/settings/IndicesSettingsAbstractAction.java +++ b/jest-common/src/main/java/io/searchbox/indices/settings/IndicesSettingsAbstractAction.java @@ -14,9 +14,7 @@ protected IndicesSettingsAbstractAction(Builder builder) { @Override protected String buildURI() { - StringBuilder sb = new StringBuilder(); - sb.append(super.buildURI()).append("/_settings"); - return sb.toString(); + return super.buildURI() + "/_settings"; } }