Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
javanna committed Jan 22, 2018
1 parent a71a770 commit 81467af
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
/**
* Base class for all broadcast operation based responses.
*/
public class BroadcastResponse extends ActionResponse {
public class BroadcastResponse extends ActionResponse {
private static final DefaultShardOperationFailedException[] EMPTY = new DefaultShardOperationFailedException[0];
private int totalShards;
private int successfulShards;
Expand All @@ -48,8 +48,11 @@ public BroadcastResponse(int totalShards, int successfulShards, int failedShards
this.totalShards = totalShards;
this.successfulShards = successfulShards;
this.failedShards = failedShards;
this.shardFailures = shardFailures == null ? EMPTY :
shardFailures.toArray(new DefaultShardOperationFailedException[shardFailures.size()]);
if (shardFailures == null) {
this.shardFailures = EMPTY;
} else {
this.shardFailures = shardFailures.toArray(new DefaultShardOperationFailedException[shardFailures.size()]);
}
}

/**
Expand Down

0 comments on commit 81467af

Please sign in to comment.