Use instanceof pattern in netconf-impl
[netconf.git] / netconf / netconf-impl / src / main / java / org / opendaylight / netconf / impl / NetconfServerSession.java
index 19601fcdca2be75f467c55c2039b8328bd4bb87f..a9cb3eb4f773321d2180581ae2ceeb1280b7fab1 100644 (file)
@@ -97,9 +97,9 @@ public final class NetconfServerSession extends AbstractNetconfSession<NetconfSe
     @Override
     public ChannelFuture sendMessage(final NetconfMessage netconfMessage) {
         final ChannelFuture channelFuture = super.sendMessage(netconfMessage);
-        if (netconfMessage instanceof NetconfNotification) {
+        if (netconfMessage instanceof NetconfNotification notification) {
             outNotification++;
-            sessionListener.onNotification(this, (NetconfNotification) netconfMessage);
+            sessionListener.onNotification(this, notification);
         }
         // delayed close was set, close after the message was sent
         if (delayedClose) {