Skip to content

Commit

Permalink
Improve readability of TypedProperties toString
Browse files Browse the repository at this point in the history
  • Loading branch information
jbertram committed Jun 19, 2023
1 parent c6a82ff commit 0521f47
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -609,17 +609,17 @@ public synchronized String toString() {
if (theValue == null) {
sb.append("NULL-value");
} else if (theValue instanceof byte[]) {
sb.append("[" + ByteUtil.maxString(ByteUtil.bytesToHex((byte[]) theValue, 2), 150) + ")");
sb.append("[" + ByteUtil.maxString(ByteUtil.bytesToHex((byte[]) theValue, 2), 150) + "]");

if (iterItem.getKey().toString().startsWith("_AMQ_ROUTE_TO")) {
sb.append(",bytesAsLongs(");
sb.append(", bytesAsLongs[");
try {
ByteBuffer buff = ByteBuffer.wrap((byte[]) theValue);
while (buff.hasRemaining()) {
long bindingID = buff.getLong();
sb.append(bindingID);
if (buff.hasRemaining()) {
sb.append(",");
sb.append(", ");
}
}
} catch (Throwable e) {
Expand All @@ -632,7 +632,7 @@ public synchronized String toString() {
}

if (iter.hasNext()) {
sb.append(",");
sb.append(", ");
}
}
}
Expand Down

0 comments on commit 0521f47

Please sign in to comment.