BGPSessionImpl unhandled msg 93/36393/4
authorIveta Halanova <ihalanov@cisco.com>
Thu, 17 Mar 2016 12:37:44 +0000 (13:37 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 17 Mar 2016 16:34:58 +0000 (16:34 +0000)
Loging unhandled msg and avoiding class cast exception.

Change-Id: I4f917cc783918bb7cc00cdbc29393a2b09cceb07
Signed-off-by: Iveta Halanova <ihalanov@cisco.com>
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPSessionImpl.java

index 9f42cae002448e189c9deb0a2cb425add83ff61d..caf24eee0f8bd2bb42628162b4bdee0de51737c2 100644 (file)
@@ -235,11 +235,12 @@ public class BGPSessionImpl extends SimpleChannelInboundHandler<Notification> im
         } else if (msg instanceof RouteRefresh) {
             this.listener.onMessage(this, msg);
             this.sessionStats.updateReceivedMsgRR();
-        } else {
-            // All others are passed up
+        } else if (msg instanceof Update) {
             this.listener.onMessage(this, msg);
             this.sync.updReceived((Update) msg);
             this.sessionStats.updateReceivedMsgUpd();
+        } else {
+            LOG.warn("Ignoring unhandled message: {}.", msg.getClass());
         }
     }