Remove extra code in allocation commands parsing (#53579)

This commit removes some code that is duplicated in the parsing of
allocation commands in the cluster reroute API.
This commit is contained in:
Jason Tedor 2020-03-14 18:11:31 -04:00
parent b7dbadeea0
commit 66374b61ca
No known key found for this signature in database
GPG Key ID: FA89F05560F16BC5
1 changed files with 0 additions and 3 deletions

View File

@ -137,9 +137,6 @@ public class AllocationCommands implements ToXContentFragment {
throw new ElasticsearchParseException("No commands");
}
if (token == XContentParser.Token.FIELD_NAME) {
if (!parser.currentName().equals("commands")) {
throw new ElasticsearchParseException("expected field name to be named [commands], got [{}] instead", parser.currentName());
}
if (!parser.currentName().equals("commands")) {
throw new ElasticsearchParseException("expected field name to be named [commands], got [{}] instead", parser.currentName());
}