Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #222 from nitram509/replace-stringbuilder-with-str…
Browse files Browse the repository at this point in the history
…ing-concatenation

Replace StringBuilder with String concatenation, as suggested by IntelliJ
  • Loading branch information
Cihat Keser committed Jul 12, 2015
2 parents 40d71d6 + 7b3f9ad commit 715627c
Show file tree
Hide file tree
Showing 37 changed files with 43 additions and 117 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions jest-common/src/main/java/io/searchbox/cluster/Health.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions jest-common/src/main/java/io/searchbox/cluster/State.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions jest-common/src/main/java/io/searchbox/core/Bulk.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions jest-common/src/main/java/io/searchbox/core/Count.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions jest-common/src/main/java/io/searchbox/core/Explain.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions jest-common/src/main/java/io/searchbox/core/MultiGet.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions jest-common/src/main/java/io/searchbox/core/MultiSearch.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions jest-common/src/main/java/io/searchbox/core/Percolate.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions jest-common/src/main/java/io/searchbox/core/Search.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions jest-common/src/main/java/io/searchbox/core/Suggest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions jest-common/src/main/java/io/searchbox/core/Update.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions jest-common/src/main/java/io/searchbox/core/Validate.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions jest-common/src/main/java/io/searchbox/indices/Analyze.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions jest-common/src/main/java/io/searchbox/indices/Flush.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions jest-common/src/main/java/io/searchbox/indices/Optimize.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Optimize, Builder> {
Expand Down
4 changes: 1 addition & 3 deletions jest-common/src/main/java/io/searchbox/indices/Refresh.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Refresh, Builder> {
Expand Down
4 changes: 1 addition & 3 deletions jest-common/src/main/java/io/searchbox/indices/Stats.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Stats, Builder> {
Expand Down
4 changes: 1 addition & 3 deletions jest-common/src/main/java/io/searchbox/indices/Status.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Status, Builder> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<GetAliases, Builder> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<GetMapping, Builder> {
Expand Down
Loading

0 comments on commit 715627c

Please sign in to comment.