From 39892fdf3e08ee346a796f1a87c7379850ce6100 Mon Sep 17 00:00:00 2001 From: Rajith Muditha Attapattu Date: Thu, 17 Dec 2009 17:22:41 +0000 Subject: This is a fix for QPID-1830 I have removed the checkReadable() method from the toBodyString() This will enable the toString() method to be used any time on message. I have also modified the Functions.str() to take in an additional parameter to denote to the starting position of the buffer. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@891805 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/qpid/client/message/AbstractBytesMessage.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'java/client') diff --git a/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesMessage.java b/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesMessage.java index 234212c301..535b55ced5 100644 --- a/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesMessage.java +++ b/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesMessage.java @@ -85,11 +85,18 @@ public abstract class AbstractBytesMessage extends AbstractJMSMessage } public String toBodyString() throws JMSException - { - checkReadable(); + { try { - return Functions.str(_data.buf(), 100); + if (_data != null) + { + return Functions.str(_data.buf(), 100,0); + } + else + { + return ""; + } + } catch (Exception e) { -- cgit v1.2.1