Bug 4933: Yang parser does not accept deviate "not-supported"
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / reactor / StatementContextBase.java
index 91301d02044df1baad6ae255cb0104a3d869aa4d..59a22343e13743e8d9531faf92dea4059bc94adb 100644 (file)
@@ -317,7 +317,8 @@ public abstract class StatementContextBase<A, D extends DeclaredStatement<A>, E
             public StatementContextBase build() throws SourceException {
                 StatementContextBase<?, ?, ?> potential = null;
 
-                if (getDefinition().getPublicView() != Rfc6020Mapping.AUGMENT) {
+                StatementDefinition stmtDef = getDefinition().getPublicView();
+                if (stmtDef != Rfc6020Mapping.AUGMENT && stmtDef != Rfc6020Mapping.DEVIATION) {
                     potential = substatements.get(createIdentifier());
                 }
                 if (potential == null) {