Fix StmtContext nullness problems
[yangtools.git] / yang / yang-parser-rfc7950 / src / main / java / org / opendaylight / yangtools / yang / parser / rfc7950 / stmt / notification / NotificationEffectiveStatementImpl.java
index 4dcd4d4f963cb6cfcb050bc01e03fc4e4dcb3a21..5bb0d4d16d6a916cd705783a98d01c739ae7b485 100644 (file)
@@ -15,7 +15,6 @@ import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Objects;
 import java.util.Set;
-import javax.annotation.Nonnull;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.AugmentationSchemaNode;
@@ -34,8 +33,8 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 final class NotificationEffectiveStatementImpl
         extends AbstractEffectiveDocumentedDataNodeContainer<QName, NotificationStatement>
         implements NotificationDefinition, NotificationEffectiveStatement {
-    private final QName qname;
-    private final SchemaPath path;
+    private final @NonNull QName qname;
+    private final @NonNull SchemaPath path;
     private final Set<AugmentationSchemaNode> augmentations;
     private final @NonNull List<UnknownSchemaNode> unknownNodes;
     private final boolean augmenting;
@@ -45,7 +44,7 @@ final class NotificationEffectiveStatementImpl
     NotificationEffectiveStatementImpl(
             final StmtContext<QName, NotificationStatement, EffectiveStatement<QName, NotificationStatement>> ctx) {
         super(ctx);
-        this.qname = ctx.getStatementArgument();
+        this.qname = ctx.coerceStatementArgument();
         this.path = ctx.getSchemaPath().get();
 
         // initSubstatementCollections
@@ -76,13 +75,11 @@ final class NotificationEffectiveStatementImpl
         }
     }
 
-    @Nonnull
     @Override
     public QName getQName() {
         return qname;
     }
 
-    @Nonnull
     @Override
     public SchemaPath getPath() {
         return path;