Align createQName @Nonnull declarations 61/79261/1
authorStephen Kitt <skitt@redhat.com>
Mon, 7 Jan 2019 08:42:09 +0000 (09:42 +0100)
committerStephen Kitt <skitt@redhat.com>
Mon, 7 Jan 2019 08:43:30 +0000 (09:43 +0100)
RFC7951JSONInstanceIdentifierCodec overrides createQName with a
mismatched lastModule annotations; this patch aligns the annotations
(@Nonnull) without changing the implementation (which throws an
IllegalArgumentException if lastModule is null).

(Caught by SpotBugs.)

Change-Id: I9e08241a5ec1c58554a0cd178e46ad4aeb061a77
Signed-off-by: Stephen Kitt <skitt@redhat.com>
yang/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/RFC7951JSONInstanceIdentifierCodec.java

index d7e716e392f5d226712279c3af5ad48829b08875..ff88f0dd4775d38c67abd6a797b03f8348cd62bf 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.yangtools.yang.data.codec.gson;
 
 import static com.google.common.base.Preconditions.checkArgument;
 
+import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.QNameModule;
@@ -30,7 +31,7 @@ final class RFC7951JSONInstanceIdentifierCodec extends JSONInstanceIdentifierCod
     }
 
     @Override
-    protected QName createQName(final @Nullable QNameModule lastModule, final String localName) {
+    protected QName createQName(final @Nonnull QNameModule lastModule, final String localName) {
         checkArgument(lastModule != null, "Unprefixed leading name %s", localName);
         return QName.create(lastModule, localName);
     }