Propagate @Nonnull and @Nullable annotations
[yangtools.git] / yang / yang-model-util / src / main / java / org / opendaylight / yangtools / yang / model / repo / util / AbstractSchemaRepository.java
index ba5a40fcfce3ac4e572567870f5344f1fa2067fa..e059265d4d21d83b9095bc675076a22c94864867 100644 (file)
@@ -24,6 +24,7 @@ import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import javax.annotation.Nonnull;
 import javax.annotation.concurrent.GuardedBy;
 import org.opendaylight.yangtools.util.concurrent.ExceptionMapper;
 import org.opendaylight.yangtools.util.concurrent.ReflectiveExceptionMapper;
@@ -73,7 +74,7 @@ public abstract class AbstractSchemaRepository implements SchemaRepository, Sche
 
         return Futures.makeChecked(Futures.withFallback(f, new FutureFallback<T>() {
             @Override
-            public ListenableFuture<T> create(final Throwable t) throws SchemaSourceException {
+            public ListenableFuture<T> create(@Nonnull final Throwable t) throws SchemaSourceException {
                 LOG.debug("Failed to acquire source from {}", reg, t);
 
                 if (it.hasNext()) {
@@ -86,7 +87,7 @@ public abstract class AbstractSchemaRepository implements SchemaRepository, Sche
     }
 
     @Override
-    public <T extends SchemaSourceRepresentation> CheckedFuture<T, SchemaSourceException> getSchemaSource(final SourceIdentifier id, final Class<T> representation) {
+    public <T extends SchemaSourceRepresentation> CheckedFuture<T, SchemaSourceException> getSchemaSource(@Nonnull final SourceIdentifier id, @Nonnull final Class<T> representation) {
         final ArrayList<AbstractSchemaSourceRegistration<?>> sortedSchemaSourceRegistrations;
 
         synchronized (this) {
@@ -118,7 +119,7 @@ public abstract class AbstractSchemaRepository implements SchemaRepository, Sche
             }
 
             @Override
-            public void onFailure(final Throwable t) {
+            public void onFailure(@Nonnull final Throwable t) {
                 LOG.trace("Skipping notification for encountered source {}, fetching source failed", id, t);
             }
         });