From 6339b240d4e797adc275d0482d6e1159c8d245bc Mon Sep 17 00:00:00 2001 From: skyguard1 Date: Fri, 3 Sep 2021 01:14:00 +0800 Subject: [PATCH] Remove useless imports and redundant type cast (#11639) Motivation: There are some redundant imports and unnecessary type cast Modification: Remove useless imports and unnecessary type cast Result: The code is cleaner than original Signed-off-by: xingrufei --- .../java/io/netty/handler/codec/mqtt/MqttMessageFactory.java | 2 +- .../io/netty/handler/ssl/ReferenceCountedOpenSslContext.java | 1 - .../java/io/netty/channel/epoll/EpollSocketConnectTest.java | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttMessageFactory.java b/codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttMessageFactory.java index 36afbe703e..f06478b1ef 100644 --- a/codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttMessageFactory.java +++ b/codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttMessageFactory.java @@ -82,7 +82,7 @@ public final class MqttMessageFactory { case AUTH: //Having MqttReasonCodeAndPropertiesVariableHeader return new MqttMessage(mqttFixedHeader, - (MqttReasonCodeAndPropertiesVariableHeader) variableHeader); + variableHeader); default: throw new IllegalArgumentException("unknown message type: " + mqttFixedHeader.messageType()); diff --git a/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslContext.java b/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslContext.java index 0b4316e135..53b13ebd0d 100644 --- a/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslContext.java +++ b/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslContext.java @@ -56,7 +56,6 @@ import java.security.cert.CertificateNotYetValidException; import java.security.cert.CertificateRevokedException; import java.security.cert.X509Certificate; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.LinkedHashSet; import java.util.List; diff --git a/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollSocketConnectTest.java b/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollSocketConnectTest.java index 31f3a2644e..378f41e0ce 100644 --- a/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollSocketConnectTest.java +++ b/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollSocketConnectTest.java @@ -17,7 +17,6 @@ package io.netty.channel.epoll; import io.netty.bootstrap.Bootstrap; import io.netty.bootstrap.ServerBootstrap; -import io.netty.channel.ChannelOption; import io.netty.testsuite.transport.TestsuitePermutation; import io.netty.testsuite.transport.socket.SocketConnectTest;