Remove module name prefix from top level element 83/12383/1
authorJozef Gloncak <jgloncak@cisco.com>
Thu, 30 Oct 2014 15:02:20 +0000 (16:02 +0100)
committerJozef Gloncak <jgloncak@cisco.com>
Thu, 30 Oct 2014 15:02:27 +0000 (16:02 +0100)
Previous patch added condition which caused that name of every top level
JSON element was printed also with module name prefix.

It caused that some test failing.

Purpose of this patch is revert this change.

Change-Id: I3c6a992048e76fe0fa5ad0369c474710999502d4
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
yang/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/JSONStreamWriterContext.java

index 00b8b280748e2f80d0481e7f8e927a48b702cd91..a3ad80dfb3f28473b523f3b12c1a1cc335063715 100644 (file)
@@ -60,7 +60,7 @@ abstract class JSONStreamWriterContext {
 
         // Prepend module name if namespaces do not match
         final URI ns = qname.getNamespace();
-        if (!ns.equals(getNamespace()) || this instanceof JSONStreamWriterRootContext) {
+        if (!ns.equals(getNamespace())) {
             final Module module = schema.findModuleByNamespaceAndRevision(ns, null);
             Preconditions.checkArgument(module != null, "Could not find module for namespace {}", ns);