Author: jmesnil
Date: 2010-09-10 05:48:22 -0400 (Fri, 10 Sep 2010)
New Revision: 9666
Modified:
branches/Branch_2_1/src/main/org/hornetq/jms/persistence/config/PersistedDestination.java
Log:
https://jira.jboss.org/browse/HORNETQ-503
* use BufferHelper helper methods to read/write String as SimpleString
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-10
02:21:18 UTC (rev 9665)
+++
branches/Branch_2_1/src/main/org/hornetq/jms/persistence/config/PersistedDestination.java 2010-09-10
09:48:22 UTC (rev 9666)
@@ -14,7 +14,6 @@
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;
@@ -113,8 +112,8 @@
public void encode(final HornetQBuffer buffer)
{
buffer.writeByte(type.getType());
- buffer.writeSimpleString(SimpleString.toSimpleString(name));
- buffer.writeNullableSimpleString(SimpleString.toSimpleString(selector));
+ BufferHelper.writeAsSimpleString(buffer, name);
+ BufferHelper.writeAsNullableSimpleString(buffer, selector);
buffer.writeBoolean(durable);
}
@@ -122,8 +121,7 @@
{
type = PersistedType.getType(buffer.readByte());
name = buffer.readSimpleString().toString();
- SimpleString selectorStr = buffer.readNullableSimpleString();
- selector = (selectorStr == null) ? null : selectorStr.toString();
+ selector = BufferHelper.readNullableSimpleStringAsString(buffer);
durable = buffer.readBoolean();
}
}