Author: clebert.suconic(a)jboss.com
Date: 2010-09-09 13:43:28 -0400 (Thu, 09 Sep 2010)
New Revision: 9663
Modified:
branches/Branch_2_1/src/main/org/hornetq/jms/persistence/config/PersistedDestination.java
Log:
HORNETQ-503 - Fix done by Jeff Mesnil (I'm just applying the patch and committing it)
Modified:
branches/Branch_2_1/src/main/org/hornetq/jms/persistence/config/PersistedDestination.java
===================================================================
---
branches/Branch_2_1/src/main/org/hornetq/jms/persistence/config/PersistedDestination.java 2010-09-09
13:00:04 UTC (rev 9662)
+++
branches/Branch_2_1/src/main/org/hornetq/jms/persistence/config/PersistedDestination.java 2010-09-09
17:43:28 UTC (rev 9663)
@@ -14,6 +14,7 @@
package org.hornetq.jms.persistence.config;
import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.SimpleString;
import org.hornetq.core.journal.EncodingSupport;
import org.hornetq.utils.BufferHelper;
import org.hornetq.utils.DataConstants;
@@ -112,16 +113,17 @@
public void encode(final HornetQBuffer buffer)
{
buffer.writeByte(type.getType());
- buffer.writeString(name);
- buffer.writeNullableString(selector);
+ buffer.writeSimpleString(SimpleString.toSimpleString(name));
+ buffer.writeNullableSimpleString(SimpleString.toSimpleString(selector));
buffer.writeBoolean(durable);
}
public void decode(final HornetQBuffer buffer)
{
type = PersistedType.getType(buffer.readByte());
- name = buffer.readString();
- selector = buffer.readNullableString();
+ name = buffer.readSimpleString().toString();
+ SimpleString selectorStr = buffer.readNullableSimpleString();
+ selector = (selectorStr == null) ? null : selectorStr.toString();
durable = buffer.readBoolean();
}
}