Skip to content

Commit 04f3e67

Browse files
scampijavanna
authored andcommitted
Remove redundant method from RestClearScrollAction (#34268)
The check for null argument is already done in `splitStringByCommaToArray`, hence it can be removed, which allows us to remove the whole splitScrollIds private method.
1 parent d51bc05 commit 04f3e67

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

server/src/main/java/org/elasticsearch/rest/action/search/RestClearScrollAction.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public String getName() {
5050
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
5151
String scrollIds = request.param("scroll_id");
5252
ClearScrollRequest clearRequest = new ClearScrollRequest();
53-
clearRequest.setScrollIds(Arrays.asList(splitScrollIds(scrollIds)));
53+
clearRequest.setScrollIds(Arrays.asList(Strings.splitStringByCommaToArray(scrollIds)));
5454
request.withContentOrSourceParamParserOrNull((xContentParser -> {
5555
if (xContentParser != null) {
5656
// NOTE: if rest request with xcontent body has request parameters, values parsed from request body have the precedence
@@ -65,10 +65,4 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC
6565
return channel -> client.clearScroll(clearRequest, new RestStatusToXContentListener<>(channel));
6666
}
6767

68-
private static String[] splitScrollIds(String scrollIds) {
69-
if (scrollIds == null) {
70-
return Strings.EMPTY_ARRAY;
71-
}
72-
return Strings.splitStringByCommaToArray(scrollIds);
73-
}
7468
}

0 commit comments

Comments
 (0)