Author: rajith
Date: Thu Dec 14 18:44:30 2006
New Revision: 487435
URL: http://svn.apache.org/viewvc?view=rev&rev=487435
Log:
This contains a fix for QPID-191 and QPID-192
Modified:
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSMapMessage.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSObjectMessage.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessage.java
Modified:
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSMapMessage.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSMapMessage.java?view=diff&rev=487435&r1=487434&r2=487435
==============================================================================
---
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSMapMessage.java
(original)
+++
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSMapMessage.java
Thu Dec 14 18:44:30 2006
@@ -53,7 +53,13 @@
}
- JMSMapMessage(long messageNbr, ContentHeaderBody contentHeader, ByteBuffer
data)
+ @Override
+ public void clearBodyImpl() throws JMSException {
+ super.clearBodyImpl();
+ _map = new PropertyFieldTable();
+ }
+
+ JMSMapMessage(long messageNbr, ContentHeaderBody contentHeader,
ByteBuffer data)
throws AMQException
{
super(messageNbr, contentHeader, data);
@@ -160,7 +166,7 @@
if (result == null)
{
- throw new MessageFormatException("getChar couldn't find " + string
+ " item.");
+ throw new NullPointerException("getChar couldn't find " + string +
" item.");
}
else
{
Modified:
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSObjectMessage.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSObjectMessage.java?view=diff&rev=487435&r1=487434&r2=487435
==============================================================================
---
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSObjectMessage.java
(original)
+++
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSObjectMessage.java
Thu Dec 14 18:44:30 2006
@@ -71,7 +71,8 @@
{
_data.release();
}
- _data = null;
+ _data = ByteBuffer.allocate(DEFAULT_BUFFER_SIZE);
+ _data.setAutoExpand(true);
}
public String toBodyString() throws JMSException
@@ -120,15 +121,18 @@
try
{
+ _data.rewind();
in = new ObjectInputStream(_data.asInputStream());
return (Serializable) in.readObject();
}
catch (IOException e)
- {
- throw new MessageFormatException("Could not deserialize message: "
+ e);
+ {
+ e.printStackTrace();
+ throw new MessageFormatException("Could not deserialize message: "
+ e);
}
catch (ClassNotFoundException e)
{
+ e.printStackTrace();
throw new MessageFormatException("Could not deserialize message: "
+ e);
}
finally
Modified:
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessage.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessage.java?view=diff&rev=487435&r1=487434&r2=487435
==============================================================================
---
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessage.java
(original)
+++
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessage.java
Thu Dec 14 18:44:30 2006
@@ -226,6 +226,10 @@
byte wireType = readWireType();
try
{
+ if(wireType == NULL_STRING_TYPE){
+ throw new NullPointerException();
+ }
+
if (wireType != CHAR_TYPE)
{
_data.position(position);
@@ -428,7 +432,7 @@
break;
case NULL_STRING_TYPE:
result = null;
- break;
+ throw new NullPointerException("data is null");
case BOOLEAN_TYPE:
checkAvailable(1);
result = String.valueOf(readBooleanImpl());