Skip to content

Commit

Permalink
Reports - better handling of null
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-lizner committed Oct 12, 2015
1 parent 6ebe1dc commit 7dc69ed
Showing 1 changed file with 7 additions and 5 deletions.
Expand Up @@ -290,7 +290,7 @@ public static String prettyPrintForReport(Object value) {
String str = PrettyPrinter.prettyPrint(value);
if (str.length() > 1000) {
return str.substring(0, 1000);
}
}
return str;

}
Expand Down Expand Up @@ -431,7 +431,7 @@ public static String prettyPrintForReport(ItemDeltaType itemDelta) {
return sb.toString();
}

public static String getBusinessDisplayName(ObjectReferenceType ort) {
public static String getBusinessDisplayName(ObjectReferenceType ort) {
return ort.getDescription();
}

Expand Down Expand Up @@ -477,9 +477,11 @@ public static String printDelta(ObjectDeltaType delta) {
ObjectType objectToAdd = (ObjectType) delta.getObjectToAdd();
if (objectToAdd != null) {
sb.append(printChangeType(delta, "Add"));
sb.append(prettyPrintForReport(objectToAdd.getClass().getSimpleName()));
sb.append("=");
sb.append(objectToAdd.getName().toString());
if (objectToAdd.getName() != null) {
sb.append(prettyPrintForReport(objectToAdd.getClass().getSimpleName()));
sb.append("=");
sb.append(objectToAdd.getName().toString());
}
sb.append(" {");
sb.append(prettyPrintForReport(objectToAdd));
sb.append("}");
Expand Down

0 comments on commit 7dc69ed

Please sign in to comment.