X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fmd-sal%2Fsal-netconf-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fconnect%2Fnetconf%2FNotificationHandler.java;h=80451a1027713174d66a90ead14bd184ee4a3721;hb=7ab97f33c1d0c7da891337d8ec0b117555914115;hp=b5927f0bd540519ca60aadd4b095df3e81acbc89;hpb=b5c49b7c32cae050b9a91ff07c0a001d7dfb0042;p=controller.git diff --git a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NotificationHandler.java b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NotificationHandler.java index b5927f0bd5..80451a1027 100644 --- a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NotificationHandler.java +++ b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NotificationHandler.java @@ -55,7 +55,10 @@ final class NotificationHandler { passNotifications = true; for (final NetconfMessage cachedNotification : queue) { - passNotification(messageTransformer.toNotification(cachedNotification)); + final CompositeNode parsedNotification = messageTransformer.toNotification(cachedNotification); + // TODO possible race condition here, because this exception is thrown occasionally + Preconditions.checkNotNull(parsedNotification, "Unable to parse received notification %s", cachedNotification); + passNotification(parsedNotification); } queue.clear(); @@ -74,7 +77,6 @@ final class NotificationHandler { private synchronized void passNotification(final CompositeNode parsedNotification) { logger.debug("{}: Forwarding notification {}", id, parsedNotification); - Preconditions.checkNotNull(parsedNotification); if(filter == null || filter.filterNotification(parsedNotification).isPresent()) { salFacade.onNotification(parsedNotification);