Propagate @Nonnull and @Nullable annotations
[yangtools.git] / yang / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / YangInstanceIdentifier.java
index 127db2ddbf0f836ac20e88a92175baa8a7f0971f..a8a02c84189d730ed8a0b55661c286d9a91bcd12 100644 (file)
@@ -264,7 +264,7 @@ public abstract class YangInstanceIdentifier implements Path<YangInstanceIdentif
     }
 
     @Override
-    public final boolean contains(final YangInstanceIdentifier other) {
+    public final boolean contains(@Nonnull final YangInstanceIdentifier other) {
         if (this == other) {
             return true;
         }
@@ -429,7 +429,7 @@ public abstract class YangInstanceIdentifier implements Path<YangInstanceIdentif
         }
 
         @Override
-        public int compareTo(final PathArgument o) {
+        public int compareTo(@Nonnull final PathArgument o) {
             return nodeType.compareTo(o.getNodeType());
         }
 
@@ -467,7 +467,7 @@ public abstract class YangInstanceIdentifier implements Path<YangInstanceIdentif
         @Override
         public String toRelativeString(final PathArgument previous) {
             if (previous instanceof AbstractPathArgument) {
-                final QNameModule mod = ((AbstractPathArgument)previous).getNodeType().getModule();
+                final QNameModule mod = previous.getNodeType().getModule();
                 if (getNodeType().getModule().equals(mod)) {
                     return getNodeType().getLocalName();
                 }
@@ -486,7 +486,7 @@ public abstract class YangInstanceIdentifier implements Path<YangInstanceIdentif
         private static final LoadingCache<QName, NodeIdentifier> CACHE = CacheBuilder.newBuilder().weakValues()
                 .build(new CacheLoader<QName, NodeIdentifier>() {
                     @Override
-                    public NodeIdentifier load(final QName key) {
+                    public NodeIdentifier load(@Nonnull final QName key) {
                         return new NodeIdentifier(key);
                     }
                 });
@@ -701,7 +701,7 @@ public abstract class YangInstanceIdentifier implements Path<YangInstanceIdentif
         }
 
         @Override
-        public int compareTo(final PathArgument o) {
+        public int compareTo(@Nonnull final PathArgument o) {
             if (!(o instanceof AugmentationIdentifier)) {
                 return -1;
             }