Fix wrong null check in TaskStatusPlus (#5678)

This commit is contained in:
Jihoon Son 2018-04-24 10:59:29 -07:00 committed by Gian Merlino
parent 2e76012aca
commit 034a0aa42b
1 changed files with 3 additions and 3 deletions

View File

@ -50,15 +50,15 @@ public class TaskStatusPlus
@JsonProperty("statusCode") @Nullable TaskState state, @JsonProperty("statusCode") @Nullable TaskState state,
@JsonProperty("duration") @Nullable Long duration, @JsonProperty("duration") @Nullable Long duration,
@JsonProperty("location") TaskLocation location, @JsonProperty("location") TaskLocation location,
@JsonProperty("dataSource") String dataSource, @JsonProperty("dataSource") @Nullable String dataSource, // nullable for backward compatibility
@JsonProperty("errorMsg") String errorMsg @JsonProperty("errorMsg") @Nullable String errorMsg
) )
{ {
if (state != null && state.isComplete()) { if (state != null && state.isComplete()) {
Preconditions.checkNotNull(duration, "duration"); Preconditions.checkNotNull(duration, "duration");
} }
this.id = Preconditions.checkNotNull(id, "id"); this.id = Preconditions.checkNotNull(id, "id");
this.type = Preconditions.checkNotNull(type, "type"); this.type = type;
this.createdTime = Preconditions.checkNotNull(createdTime, "createdTime"); this.createdTime = Preconditions.checkNotNull(createdTime, "createdTime");
this.queueInsertionTime = Preconditions.checkNotNull(queueInsertionTime, "queueInsertionTime"); this.queueInsertionTime = Preconditions.checkNotNull(queueInsertionTime, "queueInsertionTime");
this.state = state; this.state = state;