From e7d783090d0394c879b1cc5cb71ad7f1347b8df6 Mon Sep 17 00:00:00 2001 From: liugd Date: Sat, 27 Apr 2019 14:51:18 +0800 Subject: [PATCH] There's no need to null test in conjunction with an instanceof test. null is not an instanceof anything, so a null check is redundant. --- .../java/org/apache/dubbo/remoting/transport/DecodeHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/transport/DecodeHandler.java b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/transport/DecodeHandler.java index 050dc78ad21..a342c4b757e 100644 --- a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/transport/DecodeHandler.java +++ b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/transport/DecodeHandler.java @@ -52,7 +52,7 @@ public void received(Channel channel, Object message) throws RemotingException { } private void decode(Object message) { - if (message != null && message instanceof Decodeable) { + if (message instanceof Decodeable) { try { ((Decodeable) message).decode(); if (log.isDebugEnabled()) {