Skip to content

Commit 81467af

Browse files
committed
address review comments
1 parent a71a770 commit 81467af

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

server/src/main/java/org/elasticsearch/action/support/broadcast/BroadcastResponse.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
/**
3434
* Base class for all broadcast operation based responses.
3535
*/
36-
public class BroadcastResponse extends ActionResponse {
36+
public class BroadcastResponse extends ActionResponse {
3737
private static final DefaultShardOperationFailedException[] EMPTY = new DefaultShardOperationFailedException[0];
3838
private int totalShards;
3939
private int successfulShards;
@@ -48,8 +48,11 @@ public BroadcastResponse(int totalShards, int successfulShards, int failedShards
4848
this.totalShards = totalShards;
4949
this.successfulShards = successfulShards;
5050
this.failedShards = failedShards;
51-
this.shardFailures = shardFailures == null ? EMPTY :
52-
shardFailures.toArray(new DefaultShardOperationFailedException[shardFailures.size()]);
51+
if (shardFailures == null) {
52+
this.shardFailures = EMPTY;
53+
} else {
54+
this.shardFailures = shardFailures.toArray(new DefaultShardOperationFailedException[shardFailures.size()]);
55+
}
5356
}
5457

5558
/**

0 commit comments

Comments
 (0)