diff --git a/core/src/main/java/org/elasticsearch/cluster/action/shard/ShardStateAction.java b/core/src/main/java/org/elasticsearch/cluster/action/shard/ShardStateAction.java index da014e15b6b..a01f601ba12 100644 --- a/core/src/main/java/org/elasticsearch/cluster/action/shard/ShardStateAction.java +++ b/core/src/main/java/org/elasticsearch/cluster/action/shard/ShardStateAction.java @@ -152,7 +152,7 @@ public class ShardStateAction extends AbstractComponent { class ShardFailedClusterStateHandler implements ClusterStateTaskExecutor, ClusterStateTaskListener { @Override public BatchResult execute(ClusterState currentState, List tasks) throws Exception { - BatchResult.Builder builder = BatchResult.builder(); + BatchResult.Builder batchResultBuilder = BatchResult.builder(); List shardRoutingsToBeApplied = new ArrayList<>(tasks.size()); for (ShardRoutingEntry task : tasks) { task.processed = true; @@ -164,11 +164,11 @@ public class ShardStateAction extends AbstractComponent { if (result.changed()) { maybeUpdatedState = ClusterState.builder(currentState).routingResult(result).build(); } - builder.successes(tasks); + batchResultBuilder.successes(tasks); } catch (Throwable t) { - builder.failures(tasks, t); + batchResultBuilder.failures(tasks, t); } - return builder.build(maybeUpdatedState); + return batchResultBuilder.build(maybeUpdatedState); } @Override