Merge "Remove netconf-impl test resources"
[netconf.git] / netconf / netconf-notifications-impl / src / main / java / org / opendaylight / netconf / notifications / impl / osgi / Activator.java
index 21b7d0d83d6bd9fc1f999a594fddbe1522a9763a..967bd08914e17734628387badc80fe921e770be9 100644 (file)
@@ -41,18 +41,18 @@ public class Activator implements BundleActivator {
     private NetconfNotificationManager netconfNotificationManager;
 
     @Override
-    public void start(final BundleContext context) throws Exception {
+    public void start(final BundleContext context) {
         netconfNotificationManager = new NetconfNotificationManager();
         // Add properties to autowire with netconf-impl instance for cfg subsystem
         final Dictionary<String, String> props = new Hashtable<>();
         props.put(NetconfConstants.SERVICE_NAME, NetconfConstants.NETCONF_NOTIFICATION);
         netconfNotificationCollectorServiceRegistration = context.registerService(NetconfNotificationCollector.class,
-                netconfNotificationManager, new Hashtable<String, Object>());
+                netconfNotificationManager, new Hashtable<>());
 
         final NetconfOperationServiceFactory netconfOperationServiceFactory = new NetconfOperationServiceFactory() {
 
             private final Set<Capability> capabilities =
-                    Collections.<Capability>singleton(new BasicCapability(NetconfNotification.NOTIFICATION_NAMESPACE));
+                    Collections.singleton(new BasicCapability(NetconfNotification.NOTIFICATION_NAMESPACE));
 
             @Override
             public Set<Capability> getCapabilities() {
@@ -61,8 +61,8 @@ public class Activator implements BundleActivator {
 
             @Override
             public AutoCloseable registerCapabilityListener(final CapabilityListener listener) {
-                listener.onCapabilitiesChanged(capabilities, Collections.<Capability>emptySet());
-                return () -> listener.onCapabilitiesChanged(Collections.<Capability>emptySet(), capabilities);
+                listener.onCapabilitiesChanged(capabilities, Collections.emptySet());
+                return () -> listener.onCapabilitiesChanged(Collections.emptySet(), capabilities);
             }
 
             @Override
@@ -74,7 +74,7 @@ public class Activator implements BundleActivator {
 
                     @Override
                     public Set<NetconfOperation> getNetconfOperations() {
-                        return Sets.<NetconfOperation>newHashSet(
+                        return Sets.newHashSet(
                                 new Get(netconfSessionIdForReporting, netconfNotificationManager),
                                 createSubscription);
                     }
@@ -94,7 +94,7 @@ public class Activator implements BundleActivator {
     }
 
     @Override
-    public void stop(final BundleContext context) throws Exception {
+    public void stop(final BundleContext context) {
         if (netconfNotificationCollectorServiceRegistration != null) {
             netconfNotificationCollectorServiceRegistration.unregister();
             netconfNotificationCollectorServiceRegistration = null;