Bug 460 - Fix warning throughout netconf subsystem
[controller.git] / opendaylight / netconf / config-persister-impl / src / main / java / org / opendaylight / controller / netconf / persist / impl / ConfigPersisterNotificationHandler.java
index 1616857949d91c0678e7740ae2b277bfc12b25a0..40a15be70616217d81529b003f899236865d8ac8 100644 (file)
@@ -50,7 +50,7 @@ public class ConfigPersisterNotificationHandler implements Closeable {
         try {
             mBeanServerConnection.addNotificationListener(DefaultCommitOperationMXBean.OBJECT_NAME, listener, null, null);
         } catch (InstanceNotFoundException | IOException e) {
-            throw new RuntimeException("Cannot register as JMX listener to netconf", e);
+            throw new IllegalStateException("Cannot register as JMX listener to netconf", e);
         }
     }
 
@@ -79,9 +79,8 @@ class ConfigPersisterNotificationListener implements NotificationListener {
 
     @Override
     public void handleNotification(Notification notification, Object handback) {
-        if (notification instanceof NetconfJMXNotification == false) {
+        if (!(notification instanceof NetconfJMXNotification))
             return;
-        }
 
         // Socket should not be closed at this point
         // Activator unregisters this as JMX listener before close is called