diff options
3 files changed, 16 insertions, 4 deletions
diff --git a/qpid/java/common/src/main/java/org/apache/qpidity/transport/Data.java b/qpid/java/common/src/main/java/org/apache/qpidity/transport/Data.java index 72c1c3331d..4f61380809 100644 --- a/qpid/java/common/src/main/java/org/apache/qpidity/transport/Data.java +++ b/qpid/java/common/src/main/java/org/apache/qpidity/transport/Data.java @@ -83,6 +83,7 @@ public class Data implements ProtocolEvent StringBuffer str = new StringBuffer(); str.append("Data("); boolean first = true; + int left = 64; for (ByteBuffer buf : getFragments()) { if (first) @@ -93,7 +94,12 @@ public class Data implements ProtocolEvent { str.append(" | "); } - str.append(str(buf)); + str.append(str(buf, left)); + left -= buf.remaining(); + if (left < 0) + { + break; + } } str.append(")"); return str.toString(); diff --git a/qpid/java/common/src/main/java/org/apache/qpidity/transport/Session.java b/qpid/java/common/src/main/java/org/apache/qpidity/transport/Session.java index 54125eb03f..7c6b7daf85 100644 --- a/qpid/java/common/src/main/java/org/apache/qpidity/transport/Session.java +++ b/qpid/java/common/src/main/java/org/apache/qpidity/transport/Session.java @@ -123,10 +123,11 @@ public class Session extends Invoker return commandsIn++; } - void identify(Method cmd) + final void identify(Method cmd) { - cmd.setId(nextCommandId()); - log.debug("ID: [%s] %s", this.channel, cmd); + int id = nextCommandId(); + cmd.setId(id); + log.debug("ID: [%s] %s", this.channel, id); } public void processed(Method command) diff --git a/qpid/java/common/src/main/java/org/apache/qpidity/transport/util/Functions.java b/qpid/java/common/src/main/java/org/apache/qpidity/transport/util/Functions.java index a1d74a51ce..0038cdf118 100644 --- a/qpid/java/common/src/main/java/org/apache/qpidity/transport/util/Functions.java +++ b/qpid/java/common/src/main/java/org/apache/qpidity/transport/util/Functions.java @@ -70,6 +70,11 @@ public class Functions str.append('"'); + if (limit < buf.remaining()) + { + str.append("..."); + } + return str.toString(); } |