Merge "Fix For Bug #335 Bug Description : Remove SW2 property "description" to a...
authorGiovanni Meo <gmeo@cisco.com>
Wed, 29 Jan 2014 05:54:17 +0000 (05:54 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 29 Jan 2014 05:54:17 +0000 (05:54 +0000)
1  2 
opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java

index ca6987ad6cf23cb3fa142b8d6747da0cc3fa0a8e,e8104b5647f430d238b758b0ad283a42fc2f5b31..19f45e63c591dbde396e0929141c5c042a55adf5
@@@ -839,9 -839,14 +839,14 @@@ public class SwitchManager implements I
              String prop = entry.getKey();
              if (!updateProperties.containsKey(prop)) {
                  if (prop.equals(Description.propertyName)) {
-                     if (!advertisedDesc.isEmpty()) {
-                         Property desc = new Description(advertisedDesc);
-                         propMap.put(Description.propertyName, desc);
+                     if (advertisedDesc != null) {
+                         if (!advertisedDesc.isEmpty()) {
+                             Property desc = new Description(advertisedDesc);
+                             propMap.put(Description.propertyName, desc);
+                         }
+                     }
+                     else {
+                         propMap.remove(prop);
                      }
                      continue;
                  } else if (prop.equals(ForwardingMode.name)) {
              } catch (SocketException e) {
                  log.error("Failed to acquire controller MAC: ", e);
              }
 -            if (macAddress != null) {
 +            if (macAddress != null && macAddress.length != 0) {
                  break;
              }
          }