X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=yang%2Fyang-parser-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fparser%2Fstmt%2Frfc6020%2FModuleStatementSupport.java;h=0622dad4f6565e14dfd9bb7da4a6643b91ea4847;hb=fa1ed213acc06358d9b759fa871e2b360605734e;hp=05c390c1187fcc0151105ed8d02346f228f0c971;hpb=b6c40e44cb70f00473798e206707944b543ca4e2;p=yangtools.git diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/ModuleStatementSupport.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/ModuleStatementSupport.java index 05c390c118..0622dad4f6 100644 --- a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/ModuleStatementSupport.java +++ b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/ModuleStatementSupport.java @@ -122,7 +122,7 @@ public class ModuleStatementSupport extends revisionDate = Optional.of(SimpleDateFormatUtil.DEFAULT_DATE_REV); } - QNameModule qNameModule = QNameModule.create(moduleNs, revisionDate.orElse(null)).intern(); + final QNameModule qNameModule = QNameModule.create(moduleNs, revisionDate.orElse(null)).intern(); stmt.addToNs(ModuleCtxToModuleQName.class, stmt, qNameModule); } @@ -130,7 +130,7 @@ public class ModuleStatementSupport extends @Override public void onLinkageDeclared(final Mutable> stmt) { - Optional moduleNs = Optional.ofNullable(firstAttributeOf(stmt.declaredSubstatements(), + final Optional moduleNs = Optional.ofNullable(firstAttributeOf(stmt.declaredSubstatements(), NamespaceStatement.class)); SourceException.throwIf(!moduleNs.isPresent(), stmt.getStatementSourceReference(), "Namespace of the module [%s] is missing", stmt.getStatementArgument()); @@ -140,8 +140,8 @@ public class ModuleStatementSupport extends revisionDate = Optional.of(SimpleDateFormatUtil.DEFAULT_DATE_REV); } - QNameModule qNameModule = QNameModule.create(moduleNs.get(), revisionDate.orElse(null)).intern(); - ModuleIdentifier moduleIdentifier = ModuleIdentifierImpl.create(stmt.getStatementArgument(), + final QNameModule qNameModule = QNameModule.create(moduleNs.get(), revisionDate.orElse(null)).intern(); + final ModuleIdentifier moduleIdentifier = ModuleIdentifierImpl.create(stmt.getStatementArgument(), Optional.empty(), revisionDate); stmt.addContext(ModuleNamespace.class, moduleIdentifier, stmt); @@ -185,6 +185,10 @@ public class ModuleStatementSupport extends public void onFullDefinitionDeclared(final Mutable> stmt) { super.onFullDefinitionDeclared(stmt); - SUBSTATEMENT_VALIDATOR.validate(stmt); + getSubstatementValidator().validate(stmt); + } + + protected SubstatementValidator getSubstatementValidator() { + return SUBSTATEMENT_VALIDATOR; } }