if (maxChars > 0 && body.length() > maxChars) {
body = body.substring(0, maxChars) + "... [Body clipped after " + maxChars + " chars, total length is " + body.length() + "]";
}
return prepend + body;
}
<BUG>public static String dumpAsXml(Message message) {
StringBuilder sb = new StringBuilder();</BUG>
sb.append("<message>\n");
if (message.hasHeaders()) {
sb.append("<headers>\n");

if (maxChars > 0 && body.length() > maxChars) {
body = body.substring(0, maxChars) + "... [Body clipped after " + maxChars + " chars, total length is " + body.length() + "]";
}
return prepend + body;
}
public static String dumpAsXml(Message message) {
return dumpAsXml(message, true);
}
public static String dumpAsXml(Message message, boolean includeBody) {
StringBuilder sb = new StringBuilder();
sb.append("<message>\n");
if (message.hasHeaders()) {
sb.append("<headers>\n");
