Skip to content

Commit

Permalink
[FLINK-13880][core] Correct the behavior of JobExecutionResult#getAcc…
Browse files Browse the repository at this point in the history
…umulatorResult to match Javadoc

This closes apache#11698
  • Loading branch information
tsreaper committed Apr 15, 2020
1 parent 0f83584 commit 936cb65
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,12 @@ public long getNetRuntime(TimeUnit desiredUnit) {
*/
@SuppressWarnings("unchecked")
public <T> T getAccumulatorResult(String accumulatorName) {
return (T) this.accumulatorResults.get(accumulatorName).getUnchecked();
OptionalFailure<Object> result = this.accumulatorResults.get(accumulatorName);
if (result != null) {
return (T) result.getUnchecked();
} else {
return null;
}
}

/**
Expand Down

0 comments on commit 936cb65

Please sign in to comment.