Update (Abstract)StatementSupport nullness annotations 97/77197/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 23 Oct 2018 11:21:55 +0000 (13:21 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 23 Oct 2018 11:25:56 +0000 (13:25 +0200)
Use JDT annotations instead of JSR-305.

Change-Id: Ica49e1c54aba95677fb883c01d4040e4bee44c8b
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/meta/AbstractStatementSupport.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/StatementSupport.java

index ba0a930ae74f5506236aebc461e46f135fca2730..a12cd19660ed4fec5139d2c2b8bc4b15433beb30 100644 (file)
@@ -10,7 +10,8 @@ package org.opendaylight.yangtools.yang.parser.spi.meta;
 import static com.google.common.base.Preconditions.checkArgument;
 import static java.util.Objects.requireNonNull;
 
-import javax.annotation.Nullable;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
@@ -19,17 +20,14 @@ import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
  * Class providing necessary support for processing a YANG statement. This class is intended to be subclassed
  * by developers who want to add semantic support for a statement to a parser reactor.
  *
- * @param <A>
- *            Argument type
- * @param <D>
- *            Declared Statement representation
- * @param <E>
- *            Effective Statement representation
+ * @param <A> Argument type
+ * @param <D> Declared Statement representation
+ * @param <E> Effective Statement representation
  */
 public abstract class AbstractStatementSupport<A, D extends DeclaredStatement<A>, E extends EffectiveStatement<A, D>>
         implements StatementDefinition, StatementFactory<A, D, E>, StatementSupport<A, D, E> {
 
-    private final StatementDefinition type;
+    private final @NonNull StatementDefinition type;
 
     protected AbstractStatementSupport(final StatementDefinition publicDefinition) {
         this.type = requireNonNull(publicDefinition);
@@ -114,9 +112,7 @@ public abstract class AbstractStatementSupport<A, D extends DeclaredStatement<A>
     /**
      * Returns corresponding substatement validator of a statement support.
      *
-     * @return substatement validator or null, if substatement validator is not
-     *         defined
+     * @return substatement validator or null, if substatement validator is not defined
      */
-    @Nullable
-    protected abstract SubstatementValidator getSubstatementValidator();
+    protected abstract @Nullable SubstatementValidator getSubstatementValidator();
 }
index f4a63cf76f2d7b81685f2d3c6e3cf82e6177a3b6..5c6ddeee27e0e076a6621d32ac779e6892216090 100644 (file)
@@ -10,7 +10,8 @@ package org.opendaylight.yangtools.yang.parser.spi.meta;
 
 import com.google.common.annotations.Beta;
 import java.util.Optional;
-import javax.annotation.Nullable;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.QNameModule;
 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
@@ -44,22 +45,17 @@ public interface StatementSupport<A, D extends DeclaredStatement<A>, E extends E
      * Public statement definition may be used to provide different implementation of statement definition,
      * which will not retain any build specific data or context.
      *
-     * @return public statement definition, which will be present in built
-     *         statements.
+     * @return public statement definition, which will be present in built statements.
      */
-    StatementDefinition getPublicView();
+    @NonNull StatementDefinition getPublicView();
 
     /**
      * Parses textual representation of argument in object representation.
      *
-     * @param ctx
-     *            Context, which may be used to access source-specific
-     *            namespaces required for parsing.
-     * @param value
-     *            String representation of value, as was present in text source.
+     * @param ctx Context, which may be used to access source-specific namespaces required for parsing.
+     * @param value String representation of value, as was present in text source.
      * @return Parsed value
-     * @throws SourceException
-     *             when an inconsistency is detected.
+     * @throws SourceException when an inconsistency is detected.
      */
     A parseArgumentValue(StmtContext<?, ?, ?> ctx, String value);
 
@@ -167,8 +163,7 @@ public interface StatementSupport<A, D extends DeclaredStatement<A>, E extends E
      *            argument of statement
      * @return statement support specific for supplied argument or null
      */
-    @Nullable
-    StatementSupport<?, ?, ?> getSupportSpecificForArgument(String argument);
+    @Nullable StatementSupport<?, ?, ?> getSupportSpecificForArgument(String argument);
 
     /**
      * Given a raw string representation of an argument, try to use a shared representation.