Move use of EffectiveStmtCtx.caerbannog()
[yangtools.git] / yang / yang-parser-rfc7950 / src / main / java / org / opendaylight / yangtools / yang / parser / rfc7950 / stmt / notification / NotificationStatementRFC7950Support.java
index 52c15dadcb0f5f5dab7e8fcd6daf60be0c021fb3..0bead4a686cfd20e7dbc939096faf543b843b3d4 100644 (file)
@@ -66,13 +66,12 @@ public final class NotificationStatementRFC7950Support extends AbstractNotificat
     void checkEffective(final Current<QName, NotificationStatement> stmt) {
         final QName argument = stmt.argument();
         final StatementSourceReference ref = stmt.sourceReference();
-        final var rabbit = stmt.caerbannog();
-        SourceException.throwIf(StmtContextUtils.hasAncestorOfType(rabbit, ILLEGAL_PARENTS), ref,
+        SourceException.throwIf(StmtContextUtils.hasAncestorOfType(stmt, ILLEGAL_PARENTS), ref,
             "Notification %s is defined within an rpc, action, or another notification", argument);
         SourceException.throwIf(
-            !StmtContextUtils.hasAncestorOfTypeWithChildOfType(rabbit, YangStmtMapping.LIST, YangStmtMapping.KEY), ref,
+            !StmtContextUtils.hasAncestorOfTypeWithChildOfType(stmt, YangStmtMapping.LIST, YangStmtMapping.KEY), ref,
             "Notification %s is defined within a list that has no key statement", argument);
-        SourceException.throwIf(StmtContextUtils.hasParentOfType(rabbit, YangStmtMapping.CASE), ref,
+        SourceException.throwIf(StmtContextUtils.hasParentOfType(stmt, YangStmtMapping.CASE), ref,
             "Notification %s is defined within a case statement", argument);
     }
 }