Annotate @Nullable argument in SourceException 43/65143/8
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 4 Nov 2017 08:41:08 +0000 (09:41 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 8 Nov 2017 10:24:41 +0000 (11:24 +0100)
Change-Id: I439ad3c54faa170fedf5bab5f786e74d9319884c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/source/SourceException.java

index 883e0d1d8e69355de350266f181bc457586c092e..42989dce57044fc2b03691d749f3113f9ea4e618 100644 (file)
@@ -11,6 +11,7 @@ import static java.util.Objects.requireNonNull;
 
 import java.util.Optional;
 import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 
 /**
  * Thrown to indicate error in YANG model source.
@@ -110,7 +111,7 @@ public class SourceException extends RuntimeException {
      * @return Object if it is not null
      * @throws SourceException if object is null
      */
-    @Nonnull public static <T> T throwIfNull(final T obj, @Nonnull final StatementSourceReference source,
+    @Nonnull public static <T> T throwIfNull(@Nullable final T obj, @Nonnull final StatementSourceReference source,
             @Nonnull final String format, final Object... args) {
         throwIf(obj == null, source, format, args);
         return obj;