Skip to content
Snippets Groups Projects
Commit 7b5598e5 authored by brinn's avatar brinn
Browse files

fix: but in toString (must not call getResult() when isError() is true)

SVN: 7047
parent 9c50540b
No related branches found
No related tags found
No related merge requests found
......@@ -79,10 +79,14 @@ public final class DateStatus
final ToStringBuilder builder =
new ToStringBuilder(this,
ModifiedShortPrefixToStringStyle.MODIFIED_SHORT_PREFIX_STYLE);
final Long thisResult = result.getResult();
builder.append("result", thisResult != null ? String.format("%1$tF %1$tT", thisResult) : null);
builder.append("error", isError());
builder.append("message", tryGetMessage());
if (isError())
{
builder.append("[DateStatus, error: ", tryGetMessage() + "]");
} else
{
final Long thisResult = result.getResult();
builder.append("[DateStatus, result: ", String.format("%1$tF %1$tT", thisResult) + "]");
}
return builder.toString();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment