Merge "Replace exception.printStacktrace with write to log."
[controller.git] / opendaylight / switchmanager / implementation / src / main / java / org / opendaylight / controller / switchmanager / internal / SwitchManager.java
index 60330c1ad46b4709c56267578b411ccba2d4aefa..d82c9967425839dcc1fbd10efe74120c03efd03f 100644 (file)
@@ -1104,7 +1104,7 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
     @Override
     public Set<Node> getNodes() {
         return (nodeProps != null) ? new HashSet<Node>(nodeProps.keySet())
-                : null;
+                : new HashSet<Node>();
     }
 
     /*
@@ -1382,7 +1382,7 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
                         try {
                             map.put(s, new NodeConnector(entry.getValue()));
                         } catch (ConstructionException e) {
-                            e.printStackTrace();
+                            log.error("An error occured",e);
                         }
                     }
                 }
@@ -1444,7 +1444,7 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
                             try {
                                 map.put(s, new NodeConnector(entry.getValue()));
                             } catch (ConstructionException e) {
-                                e.printStackTrace();
+                                log.error("An error occured",e);
                             }
                         }
                         map.remove(name.getValue());
@@ -1481,7 +1481,7 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
                         try {
                             map.put(s, new NodeConnector(entry.getValue()));
                         } catch (ConstructionException e) {
-                            e.printStackTrace();
+                            log.error("An error occured",e);
                         }
                     }
                     map.remove(name.getValue());