diff options
author | Anton Tananaev <anton@traccar.org> | 2024-07-06 17:46:17 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2024-07-06 17:46:17 -0700 |
commit | b8390005722dd1cdb24d762797ef3f98ebc37755 (patch) | |
tree | caabf1a7541aebc4e81565e95ee78e2d8afe3d75 /src/main/java/org/traccar/WrapperInboundHandler.java | |
parent | 75e3c6a6bbb028b2f99b06faac66d5b53cf59900 (diff) | |
download | trackermap-server-b8390005722dd1cdb24d762797ef3f98ebc37755.tar.gz trackermap-server-b8390005722dd1cdb24d762797ef3f98ebc37755.tar.bz2 trackermap-server-b8390005722dd1cdb24d762797ef3f98ebc37755.zip |
Update instanceof expressions
Diffstat (limited to 'src/main/java/org/traccar/WrapperInboundHandler.java')
-rw-r--r-- | src/main/java/org/traccar/WrapperInboundHandler.java | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/WrapperInboundHandler.java b/src/main/java/org/traccar/WrapperInboundHandler.java index 5e2b1d304..7acca9c50 100644 --- a/src/main/java/org/traccar/WrapperInboundHandler.java +++ b/src/main/java/org/traccar/WrapperInboundHandler.java @@ -52,8 +52,7 @@ public class WrapperInboundHandler implements ChannelInboundHandler { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { - if (msg instanceof NetworkMessage) { - NetworkMessage nm = (NetworkMessage) msg; + if (msg instanceof NetworkMessage nm) { handler.channelRead(new WrapperContext(ctx, nm.getRemoteAddress()), nm.getMessage()); } else { handler.channelRead(ctx, msg); @@ -85,7 +84,6 @@ public class WrapperInboundHandler implements ChannelInboundHandler { handler.handlerRemoved(ctx); } - @SuppressWarnings("deprecation") @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { handler.exceptionCaught(ctx, cause); |