Merge "Bug 849: Fixed NPE in Translated Data Change Events."
authorGiovanni Meo <gmeo@cisco.com>
Mon, 12 May 2014 11:05:43 +0000 (11:05 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 12 May 2014 11:05:43 +0000 (11:05 +0000)
1  2 
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/AbstractForwardedDataBroker.java

@@@ -99,7 -99,7 +99,7 @@@ public abstract class AbstractForwarded
                  Entry<InstanceIdentifier<? extends DataObject>, DataObject> binding = getCodec().toBinding(entry);
                  newMap.put(binding.getKey(), binding.getValue());
              } catch (DeserializationException e) {
 -                LOG.debug("Omitting {}", entry, e);
 +                LOG.warn("Failed to transform {}, omitting it", entry, e);
              }
          }
          return newMap;
                  InstanceIdentifier<? extends DataObject> binding = getCodec().toBinding(normalizedPath);
                  hashSet.add(binding);
              } catch (DeserializationException e) {
 -                LOG.debug("Omitting {}", normalizedPath, e);
 +                LOG.warn("Failed to transform {}, omitting it", normalizedPath, e);
              }
          }
          return hashSet;
          @Override
          public DataObject getOriginalSubtree() {
              if (originalDataCache == null) {
-                 originalDataCache = toBindingData(path, domEvent.getOriginalSubtree());
+                 if(domEvent.getOriginalSubtree() != null) {
+                     originalDataCache = toBindingData(path, domEvent.getOriginalSubtree());
+                 } else {
+                     originalDataCache = Optional.absent();
+                 }
              }
              return originalDataCache.orNull();
          }
          @Override
          public DataObject getUpdatedSubtree() {
              if (updatedDataCache == null) {
-                 updatedDataCache = toBindingData(path, domEvent.getUpdatedSubtree());
+                 if(domEvent.getUpdatedSubtree() != null) {
+                     updatedDataCache = toBindingData(path, domEvent.getUpdatedSubtree());
+                 } else {
+                     updatedDataCache = Optional.absent();
+                 }
              }
              return updatedDataCache.orNull();
          }
  

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.