Do not format QNames to string on input
[controller.git] / opendaylight / md-sal / sal-clustering-commons / src / main / java / org / opendaylight / controller / cluster / datastore / node / utils / stream / NormalizedNodeInputStreamReader.java
index 4e7216d..9b2ce2b 100755 (executable)
@@ -58,8 +58,6 @@ public class NormalizedNodeInputStreamReader implements NormalizedNodeDataInput
 
     private static final Logger LOG = LoggerFactory.getLogger(NormalizedNodeInputStreamReader.class);
 
-    private static final String REVISION_ARG = "?revision=";
-
     private final DataInput input;
 
     private final List<String> codedStringMap = new ArrayList<>();
@@ -71,8 +69,6 @@ public class NormalizedNodeInputStreamReader implements NormalizedNodeDataInput
     @SuppressWarnings("rawtypes")
     private NormalizedNodeBuilder<NodeWithValue, Object, LeafSetEntryNode<Object>> leafSetEntryBuilder;
 
-    private final StringBuilder reusableStringBuilder = new StringBuilder(50);
-
     private boolean readSignatureMarker = true;
 
     NormalizedNodeInputStreamReader(final DataInput input, final boolean versionChecked) {
@@ -225,18 +221,9 @@ public class NormalizedNodeInputStreamReader implements NormalizedNodeDataInput
         // Read in the same sequence of writing
         String localName = readCodedString();
         String namespace = readCodedString();
-        String revision = readCodedString();
-
-        String qname;
-        if (!Strings.isNullOrEmpty(revision)) {
-            qname = reusableStringBuilder.append('(').append(namespace).append(REVISION_ARG).append(revision)
-                    .append(')').append(localName).toString();
-        } else {
-            qname = reusableStringBuilder.append('(').append(namespace).append(')').append(localName).toString();
-        }
+        String revision = Strings.emptyToNull(readCodedString());
 
-        reusableStringBuilder.delete(0, reusableStringBuilder.length());
-        return QNameFactory.create(qname);
+        return QNameFactory.create(new QNameFactory.Key(localName, namespace, revision));
     }
 
 

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.