Cleanup nullness in StatementSourceReference 96/77196/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 23 Oct 2018 11:15:16 +0000 (13:15 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 23 Oct 2018 11:16:04 +0000 (13:16 +0200)
getStatementSource() must return non-null, make sure we express
it in the contract.

Change-Id: Ifa098ce7bda78878ad5a333849c1c254f111dfbd
JIRA: YANGTOOLS-907
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/source/StatementSourceReference.java

index f686149439a4e4c1a843f8da877c26eca406f995..59c3dfdf7787e4f4c7e5d9c801a2435a82a93a39 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.yangtools.yang.parser.spi.source;
 
+import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.model.api.meta.StatementSource;
 
 /**
@@ -21,19 +22,17 @@ public interface StatementSourceReference {
     /**
      * Returns source type.
      *
-     * @return {@link StatementSource#DECLARATION} if statement was explicitly
-     *         declared in YANG model source, {@link StatementSource#CONTEXT} if statement
-     *         was inferred.
+     * @return {@link StatementSource#DECLARATION} if statement was explicitly declared in YANG model source,
+     *         {@link StatementSource#CONTEXT} if statement was inferred.
      */
-    StatementSource getStatementSource();
+    @NonNull StatementSource getStatementSource();
 
     /**
      * Returns human readable representation of statement source.
      *
      * <p>
-     * Implementations of this interface should override {@link #toString()},
-     * since it may be used in error reporting to provide context
-     * information for model designer to debug errors in its mode.
+     * Implementations of this interface should override {@link #toString()}, since it may be used in error reporting
+     * to provide context information for model designer to debug errors in its mode.
      *
      * @return human readable representation of statement source.
      */