Skip to content

Commit

Permalink
Backporting result computation fix
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Mar 30, 2013
1 parent cc4cc7e commit 6c485c3
Showing 1 changed file with 14 additions and 1 deletion.
Expand Up @@ -505,6 +505,7 @@ public void computeStatusComposite() {
boolean allOk = true;
boolean allNotApplicable = true;
boolean hasInProgress = false;
boolean hasHandledError = false;
for (OperationResult sub : getSubresults()) {
if (sub.getStatus() != OperationResultStatus.NOT_APPLICABLE) {
allNotApplicable = false;
Expand Down Expand Up @@ -533,12 +534,24 @@ public void computeStatusComposite() {
message = message + ", " + sub.getMessage();
}
}
if (sub.getStatus() == OperationResultStatus.HANDLED_ERROR) {
hasHandledError = true;
if (message == null) {
message = sub.getMessage();
} else {
message = message + ", " + sub.getMessage();
}
}
}

if (allNotApplicable) {
status = OperationResultStatus.NOT_APPLICABLE;
} else if (allOk) {
status = OperationResultStatus.SUCCESS;
if (hasHandledError) {
status = OperationResultStatus.HANDLED_ERROR;
} else {
status = OperationResultStatus.SUCCESS;
}
} else if (hasInProgress) {
status = OperationResultStatus.IN_PROGRESS;
} else {
Expand Down

0 comments on commit 6c485c3

Please sign in to comment.