Sonar clean-up: braces for control statements
[ovsdb.git] / openstack / net-virt / src / main / java / org / opendaylight / ovsdb / openstack / netvirt / impl / EventDispatcherImpl.java
index d9a1f8daaacfc6a0c9eb7301be7f0af53cc7acee..129276c32efa4fda8f2aae63b0acc44d9d4df790 100644 (file)
@@ -74,8 +74,9 @@ public class EventDispatcherImpl implements EventDispatcher, ConfigInterface {
             if (!eventHandler.awaitTermination(10, TimeUnit.SECONDS)) {
                 eventHandler.shutdownNow();
                 // Wait a while for tasks to respond to being cancelled
-                if (!eventHandler.awaitTermination(10, TimeUnit.SECONDS))
+                if (!eventHandler.awaitTermination(10, TimeUnit.SECONDS)) {
                     logger.error("Dispatcher's event handler did not terminate");
+                }
             }
         } catch (InterruptedException e) {
             // (Re-)Cancel if current thread also interrupted
@@ -100,13 +101,14 @@ public class EventDispatcherImpl implements EventDispatcher, ConfigInterface {
         Long pid = (Long) ref.getProperty(org.osgi.framework.Constants.SERVICE_ID);
         Object handlerTypeObject = ref.getProperty(Constants.EVENT_HANDLER_TYPE_PROPERTY);
         if (!(handlerTypeObject instanceof AbstractEvent.HandlerType)){
-            logger.error("Abstract handler reg failed to provide a valid handler type {}", handlerTypeObject);
+            logger.error("Abstract handler reg failed to provide a valid handler type: {} ref: {} handler: {}",
+                    handlerTypeObject, ref.getClass().getName(), handler.getClass().getName());
             return;
         }
         AbstractEvent.HandlerType handlerType = (AbstractEvent.HandlerType) handlerTypeObject;
         handlers[handlerType.ordinal()] = handler;
-        logger.debug("Event handler for type {} registered for {}, pid {}",
-                     handlerType, handler.getClass().getName(), pid);
+        logger.info("eventHandlerAdded: handler: {}, pid: {}, type: {}",
+                handler.getClass().getName(), pid, handlerType);
     }
 
     public void eventHandlerRemoved(final ServiceReference ref){