Use arrow cases in mdsal-replicate-netty
[mdsal.git] / replicate / mdsal-replicate-netty / src / main / java / org / opendaylight / mdsal / replicate / netty / SinkRequestHandler.java
index 6d0d13080de370dd3240ed8c7bfd21432122cf33..759472cef3c364f4aed3a6b46739f990b36b64f8 100644 (file)
@@ -61,21 +61,14 @@ final class SinkRequestHandler extends SimpleChannelInboundHandler<ByteBuf> {
         final Channel channel = ctx.channel();
         LOG.trace("Channel {} received message type {}", channel, msgType);
         switch (msgType) {
-            case Constants.MSG_EMPTY_DATA:
-                handleEmptyData();
-                break;
-            case Constants.MSG_DTC_CHUNK:
-                chunks.add(msg.retain());
-                break;
-            case Constants.MSG_DTC_APPLY:
-                handleDtcApply();
-                break;
-            case Constants.MSG_PING:
+            case Constants.MSG_EMPTY_DATA -> handleEmptyData();
+            case Constants.MSG_DTC_CHUNK -> chunks.add(msg.retain());
+            case Constants.MSG_DTC_APPLY -> handleDtcApply();
+            case Constants.MSG_PING -> {
                 LOG.trace("Received PING from Source, sending PONG");
                 ctx.channel().writeAndFlush(Constants.PONG);
-                break;
-            default:
-                throw new IllegalStateException("Unexpected message type " + msgType);
+            }
+            default -> throw new IllegalStateException("Unexpected message type " + msgType);
         }
     }