From 66374b61ca7116f7e6419383885f896a8b1fa08f Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Sat, 14 Mar 2020 18:11:31 -0400 Subject: [PATCH] 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. --- .../cluster/routing/allocation/command/AllocationCommands.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocationCommands.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocationCommands.java index 67122cb3ff1..4f7da131977 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocationCommands.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocationCommands.java @@ -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()); }