in class AbstractExplicitGenerator: final @NonNull AbstractExplicitGenerator resolveSchemaNode(final @NonNull SchemaNodeIdentifier path, final @Nullable QNameModule targetModule) { AbstractExplicitGenerator current = this; QNameModule currentModule = targetModule; // null initially // here comes the augment path where all the QNames up to afi-safi are bound to openconfig-network-instance NS and the rest starting with the l2vpn-evpn // are bound to openconfig-bgp-evpn-ext NS for (QName next : path.getNodeIdentifiers()) { final QName qname = currentModule == null ? next : next.bindTo(currentModule); current = verifyNotNull(current.findSchemaTreeGenerator(qname), "Failed to find %s as %s in %s", next, qname, current); // When we cycle through to bgp container, the NS does not match, as the bgp is copied to openconfig-network-instance:protocol from another module. // The currentModule variable is thus changed to the NS of that module (openconfig-bgp). // The same happens for next node in the path, i.e. rib container comes from a grouping from openconfig-rib-bgp module that was used in the grouping // in the openconfig-bgp module that got copied into openconfig-network-instance:protocol. // Then next two nodes (afi-safis and afi-safi) belong to the same NS as the currentModule, so everything goes fine. // But then we get to the l2vpn-evpn container which was augmented into afi-safi list from the openconfig-bgp-evpn-ext module. // As the currentModule is still set to the openconfig-rib-bgp NS, there l2vpn-evpn qname gets bound to the NS of that module and fails to be // found in the current afi-safi list where it is stored with the openconfig-bgp-evpn-ext NS. // And thus we get the exception in the verifyNotNull(...) final QNameModule foundNamespace = current.getQName().getModule(); if (!foundNamespace.equals(qname.getModule())) { // We have located a different QName than the one we were looking for. We need to make sure we adjust // all subsequent QNames to this new namespace currentModule = foundNamespace; } } return current; }