aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/WrapperInboundHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/WrapperInboundHandler.java')
-rw-r--r--src/main/java/org/traccar/WrapperInboundHandler.java4
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);