Fix mapping of Revision in Deviations
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / utils / mapping / RestconfMappingNodeUtil.java
index 8361ace56e2cf819f096af70c9ce5eb5d0e11363..8a3fed5c00eb651958f39b054a1006ed1f3e8dd2 100644 (file)
@@ -197,14 +197,8 @@ public final class RestconfMappingNodeUtil {
             final DataContainerNodeBuilder<NodeIdentifierWithPredicates, MapEntryNode> deviationEntryNode =
                     Builders.mapEntryBuilder((ListSchemaNode) deviationsSchema);
             final QName lastComponent = deviation.getTargetPath().getLastComponent();
-            addChildOfModuleBySpecificModuleInternal(IetfYangLibrary.SPECIFIC_MODULE_NAME_LEAF_QNAME,
-                    deviationEntryNode, context.findModule(lastComponent.getModule()).get().getName(),
-                    ietfYangLibraryModule);
-            if (lastComponent.getRevision().isPresent()) {
-                addChildOfModuleBySpecificModuleInternal(IetfYangLibrary.SPECIFIC_MODULE_REVISION_LEAF_QNAME,
-                        deviationEntryNode, lastComponent.getRevision(),
-                        ietfYangLibraryModule);
-            }
+            addCommonLeafs(context.findModule(lastComponent.getModule()).get(), deviationEntryNode,
+                ietfYangLibraryModule);
             deviations.withChild(deviationEntryNode.build());
         }
         mapEntryBuilder.withChild(deviations.build());