.addAny(YangStmtMapping.TYPEDEF)
.addAny(YangStmtMapping.USES)
.addOptional(YangStmtMapping.YANG_VERSION)
- .addOptional(SupportedExtensionsMapping.SEMANTIC_VERSION)
+ .addOptional(SupportedExtensionsMapping.OPENCONFIG_VERSION)
.build();
public ModuleStatementSupport() {
}
final QNameModule qNameModule = QNameModule.create(moduleNs.get(), revisionDate.orElse(null)).intern();
+
+ final StmtContext<?, ModuleStatement, EffectiveStatement<String, ModuleStatement>> possibleDuplicateModule =
+ stmt.getFromNamespace(NamespaceToModule.class, qNameModule);
+ if (possibleDuplicateModule != null && possibleDuplicateModule != stmt) {
+ throw new SourceException(stmt.getStatementSourceReference(), "Module namespace collision: %s. At %s",
+ qNameModule.getNamespace(), possibleDuplicateModule.getStatementSourceReference());
+ }
+
final ModuleIdentifier moduleIdentifier = ModuleIdentifierImpl.create(stmt.getStatementArgument(),
Optional.empty(), revisionDate);