Merge "Checkstyle enforcer"
[controller.git] / opendaylight / protocol_plugins / openflow / src / main / java / org / opendaylight / controller / protocol_plugin / openflow / core / internal / Controller.java
index bfa6f0ba0ff341fafda217a03eb32614238efc2c..7fb5f9fcf134c2b83a4d6534dca9356af206103b 100644 (file)
@@ -70,7 +70,7 @@ public class Controller implements IController, CommandProvider {
                         ISwitch existingSwitch = switches.get(sid);
                         if (existingSwitch != null) {
                             logger.info("Replacing existing {} with New {}",
-                                    existingSwitch.toString(), sw.toString());
+                                    existingSwitch, sw);
                             disconnectSwitch(existingSwitch);
                         }
                         switches.put(sid, sw);
@@ -107,7 +107,7 @@ public class Controller implements IController, CommandProvider {
     /**
      * Function called by the dependency manager when all the required
      * dependencies are satisfied
-     * 
+     *
      */
     public void init() {
         logger.debug("Initializing!");
@@ -122,7 +122,7 @@ public class Controller implements IController, CommandProvider {
     /**
      * Function called by dependency manager after "init ()" is called and after
      * the services provided by the class are registered in the service registry
-     * 
+     *
      */
     public void start() {
         logger.debug("Starting!");
@@ -145,7 +145,7 @@ public class Controller implements IController, CommandProvider {
      * Function called by the dependency manager before the services exported by
      * the component are unregistered, this will be followed by a "destroy ()"
      * calls
-     * 
+     *
      */
     public void stop() {
         for (Iterator<Entry<Long, ISwitch>> it = switches.entrySet().iterator(); it
@@ -166,7 +166,7 @@ public class Controller implements IController, CommandProvider {
      * Function called by the dependency manager when at least one dependency
      * become unsatisfied or when the component is shutting down because for
      * example bundle is being stopped.
-     * 
+     *
      */
     public void destroy() {
     }
@@ -175,20 +175,18 @@ public class Controller implements IController, CommandProvider {
     public void addMessageListener(OFType type, IMessageListener listener) {
         IMessageListener currentListener = this.messageListeners.get(type);
         if (currentListener != null) {
-            logger.warn("{} is already listened by {}", type.toString(),
-                    currentListener.toString());
+            logger.warn("{} is already listened by {}", type,
+                    currentListener);
         }
         this.messageListeners.put(type, listener);
-        logger.debug("{} is now listened by {}", type.toString(),
-                listener.toString());
+        logger.debug("{} is now listened by {}", type, listener);
     }
 
     @Override
     public void removeMessageListener(OFType type, IMessageListener listener) {
         IMessageListener currentListener = this.messageListeners.get(type);
         if ((currentListener != null) && (currentListener == listener)) {
-            logger.debug("{} listener {} is Removed", type.toString(),
-                    listener.toString());
+            logger.debug("{} listener {} is Removed", type, listener);
             this.messageListeners.remove(type);
         }
     }
@@ -197,19 +195,17 @@ public class Controller implements IController, CommandProvider {
     public void addSwitchStateListener(ISwitchStateListener listener) {
         if (this.switchStateListener != null) {
             logger.warn("Switch events are already listened by {}",
-                    this.switchStateListener.toString());
+                    this.switchStateListener);
         }
         this.switchStateListener = listener;
-        logger.debug("Switch events are now listened by {}",
-                listener.toString());
+        logger.debug("Switch events are now listened by {}", listener);
     }
 
     @Override
     public void removeSwitchStateListener(ISwitchStateListener listener) {
         if ((this.switchStateListener != null)
                 && (this.switchStateListener == listener)) {
-            logger.debug("SwitchStateListener {} is Removed",
-                    listener.toString());
+            logger.debug("SwitchStateListener {} is Removed", listener);
             this.switchStateListener = null;
         }
     }
@@ -228,7 +224,7 @@ public class Controller implements IController, CommandProvider {
                     instanceName);
             switchHandler.start();
             if (sc.isConnected()) {
-                logger.info("Switch:{} is connected to the Controller", 
+                logger.info("Switch:{} is connected to the Controller",
                         sc.socket().getRemoteSocketAddress()
                         .toString().split("/")[1]);
             }
@@ -242,7 +238,7 @@ public class Controller implements IController, CommandProvider {
         if (((SwitchHandler) sw).isOperational()) {
             Long sid = sw.getId();
             if (this.switches.remove(sid, sw)) {
-                logger.warn("{} is Disconnected", sw.toString());
+                logger.warn("{} is Disconnected", sw);
                 notifySwitchDeleted(sw);
             }
         }