Rather than performing two instanceof checks, use an if/else
construct to dispatch message.
Change-Id: I4ce5aba7e1c826fe343b279c9767193d0ba83154
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
@Override
public void onMessage(final BGPSession session, final Notification msg) throws BGPDocumentedException {
- if (!(msg instanceof Update) && !(msg instanceof RouteRefresh)) {
- LOG.info("Ignoring unhandled message class {}", msg.getClass());
- return;
- }
if (msg instanceof Update) {
onUpdateMessage((Update) msg);
- } else {
+ } else if (msg instanceof RouteRefresh) {
onRouteRefreshMessage((RouteRefresh) msg);
+ } else {
+ LOG.info("Ignoring unhandled message class {}", msg.getClass());
}
}