Migrate OSGI compendium reference
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / md / sal / binding / compat / HeliumNotificationProviderServiceWithInterestListeners.java
index ee64e470806f6f7d672cb0f9173efeae24a64d96..88ba4ea482865178bdcd2b0409f86603d78ccd7a 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.controller.md.sal.binding.compat;
 
 import com.google.common.collect.Sets;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.Set;
@@ -27,6 +28,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+@Deprecated(forRemoval = true)
 public class HeliumNotificationProviderServiceWithInterestListeners extends HeliumNotificationProviderServiceAdapter {
 
     private static final Logger LOG = LoggerFactory.getLogger(
@@ -58,9 +60,12 @@ public class HeliumNotificationProviderServiceWithInterestListeners extends Heli
         return codec.getNotificationClasses(added);
     }
 
+    @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
+            justification = "https://github.com/spotbugs/spotbugs/issues/811")
     @SuppressWarnings("checkstyle:IllegalCatch")
     private void notifyAllListeners(final Set<SchemaPath> added) {
-        final Iterator<ListenerRegistration<NotificationInterestListener>> listeners = interestListeners.iterator();
+        final Iterator<? extends ListenerRegistration<? extends NotificationInterestListener>> listeners =
+                interestListeners.getRegistrations().iterator();
         if (listeners.hasNext()) {
             final Set<Class<? extends Notification>> baEvent = translate(added);
             while (listeners.hasNext()) {
@@ -68,7 +73,7 @@ public class HeliumNotificationProviderServiceWithInterestListeners extends Heli
                 try {
                     notifyListener(listenerRef, baEvent);
                 } catch (RuntimeException  e) {
-                    LOG.warn("Unhandled exception during invoking listener {}", e, listenerRef);
+                    LOG.warn("Unhandled exception during invoking listener {}", listenerRef, e);
                 }
             }
         }
@@ -90,7 +95,7 @@ public class HeliumNotificationProviderServiceWithInterestListeners extends Heli
         };
     }
 
-    private void notifyListener(final NotificationInterestListener listener,
+    private static void notifyListener(final NotificationInterestListener listener,
             final Set<Class<? extends Notification>> baEvent) {
         for (final Class<? extends Notification> event: baEvent) {
             listener.onNotificationSubscribtion(event);
@@ -114,7 +119,7 @@ public class HeliumNotificationProviderServiceWithInterestListeners extends Heli
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         super.close();
         domListener.close();
     }