Author: clebert.suconic(a)jboss.com
Date: 2010-09-14 17:54:18 -0400 (Tue, 14 Sep 2010)
New Revision: 9685
Modified:
branches/Branch_2_1/src/main/org/hornetq/jms/persistence/config/PersistedDestination.java
Log:
tweak (sync with trunk)
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-14
08:38:01 UTC (rev 9684)
+++
branches/Branch_2_1/src/main/org/hornetq/jms/persistence/config/PersistedDestination.java 2010-09-14
21:54:18 UTC (rev 9685)
@@ -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,8 +113,8 @@
public void encode(final HornetQBuffer buffer)
{
buffer.writeByte(type.getType());
- BufferHelper.writeAsSimpleString(buffer, name);
- BufferHelper.writeAsNullableSimpleString(buffer, selector);
+ buffer.writeSimpleString(SimpleString.toSimpleString(name));
+ buffer.writeNullableSimpleString(SimpleString.toSimpleString(selector));
buffer.writeBoolean(durable);
}
@@ -121,7 +122,8 @@
{
type = PersistedType.getType(buffer.readByte());
name = buffer.readSimpleString().toString();
- selector = BufferHelper.readNullableSimpleStringAsString(buffer);
+ SimpleString selectorStr = buffer.readNullableSimpleString();
+ selector = (selectorStr == null) ? null : selectorStr.toString();
durable = buffer.readBoolean();
}
}