Propagate @Nonnull and @Nullable annotations
[yangtools.git] / common / util / src / main / java / org / opendaylight / yangtools / util / UnmodifiableCollection.java
index ca6415f0e31b928c9f5d6ef11b5472262dc87ef0..96895025b03766a5f5696a7ec9b04b9ee21b953e 100644 (file)
@@ -24,10 +24,9 @@ import javax.annotation.Nonnull;
  * {@link Collections#unmodifiableCollection(Collection)}, this class checks its
  * argument to ensure multiple encapsulation does not occur.
  *
- * this class checks
+ * <p>This class checks
  * the argument so it prevents multiple encapsulation. Subclasses of
  * {@link ImmutableCollection} are also recognized and not encapsulated.
- * An attempt is also made to identi
  *
  * @param <E> the type of elements in this collection
  */
@@ -69,6 +68,7 @@ public final class UnmodifiableCollection<E> implements Collection<E>, Serializa
         return new UnmodifiableCollection<>(collection);
     }
 
+    @Nonnull
     @Override
     public Iterator<E> iterator() {
         return Iterators.unmodifiableIterator(delegate.iterator());
@@ -95,12 +95,12 @@ public final class UnmodifiableCollection<E> implements Collection<E>, Serializa
     }
 
     @Override
-    public <T> T[] toArray(final T[] a) {
+    public <T> T[] toArray(@Nonnull final T[] a) {
         return delegate.toArray(a);
     }
 
     @Override
-    public boolean containsAll(final Collection<?> c) {
+    public boolean containsAll(@Nonnull final Collection<?> c) {
         return delegate.containsAll(c);
     }
 
@@ -110,7 +110,7 @@ public final class UnmodifiableCollection<E> implements Collection<E>, Serializa
     }
 
     @Override
-    public boolean addAll(final Collection<? extends E> c) {
+    public boolean addAll(@Nonnull final Collection<? extends E> c) {
         throw new UnsupportedOperationException();
     }
 
@@ -120,12 +120,12 @@ public final class UnmodifiableCollection<E> implements Collection<E>, Serializa
     }
 
     @Override
-    public boolean removeAll(final Collection<?> c) {
+    public boolean removeAll(@Nonnull final Collection<?> c) {
         throw new UnsupportedOperationException();
     }
 
     @Override
-    public boolean retainAll(final Collection<?> c) {
+    public boolean retainAll(@Nonnull final Collection<?> c) {
         throw new UnsupportedOperationException();
     }