BUG 1441: Fixed JSONNormalizedNodeStreamWriter bug in writing list items. 21/10621/1
authorTony Tkacik <ttkacik@cisco.com>
Tue, 2 Sep 2014 10:52:39 +0000 (12:52 +0200)
committerTony Tkacik <ttkacik@cisco.com>
Tue, 2 Sep 2014 10:52:39 +0000 (12:52 +0200)
Change-Id: I3c3b14bd48e2bdbfc126284fe6e4a3e469b7a47e
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
yang/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/JSONNormalizedNodeStreamWriter.java

index 7da9c00cbf3cbf2907369e3c25cc6be9c4018912..c1a4c31d43f1c1b21146fd1dd87f84ff2ae556d9 100644 (file)
@@ -226,9 +226,10 @@ public class JSONNormalizedNodeStreamWriter implements NormalizedNodeStreamWrite
     public void startMapEntryNode(final NodeIdentifierWithPredicates identifier, final int childSizeHint)
             throws IOException {
         tracker.startListItem(identifier);
-
-        stack.push(new TypeInfo(NodeType.OBJECT, identifier.getNodeType().getNamespace()));
         separateElementFromPreviousElement();
+        stack.push(new TypeInfo(NodeType.OBJECT, identifier.getNodeType().getNamespace()));
+
+
         writeStartObject();
         indentRight();
     }