Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
rhbz1082840 - make HTextFlowTarget toString method more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Huang committed May 21, 2015
1 parent 0d56ed3 commit 7567944
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions zanata-model/src/main/java/org/zanata/model/HTextFlowTarget.java
Expand Up @@ -395,9 +395,16 @@ public HTextFlowTargetReviewComment addReviewComment(String comment,

@Override
public String toString() {
return MoreObjects.toStringHelper(this).add("contents", getContents())
.add("locale", getLocale()).add("state", getState())
.add("comment", getComment())
MoreObjects.ToStringHelper helper =
MoreObjects.toStringHelper(this)
.add("contents", getContents())
.add("locale", getLocale())
.add("state", getState())
.add("comment", getComment());
if (getTextFlow() == null) {
return helper.toString();
}
return helper
.add("textFlow", getTextFlow().getContents()).toString();
}

Expand Down

0 comments on commit 7567944

Please sign in to comment.