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 <xingrufei@sogou-inc.com>
This commit is contained in:
skyguard1 2021-09-03 01:14:00 +08:00 committed by GitHub
parent 5ebdee8537
commit d58d8a1df8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 7 additions and 14 deletions

View File

@ -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());

View File

@ -48,7 +48,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;

View File

@ -25,7 +25,6 @@ import io.netty.internal.tcnative.SSL;
import io.netty.util.CharsetUtil;
import io.netty.util.internal.EmptyArrays;
import io.netty.util.internal.PlatformDependent;
import io.netty.util.internal.ResourcesUtil;
import org.junit.AssumptionViolatedException;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
@ -36,7 +35,6 @@ import org.junit.jupiter.params.provider.MethodSource;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLEngineResult;
import javax.net.ssl.SSLEngineResult.HandshakeStatus;
@ -44,14 +42,12 @@ import javax.net.ssl.SSLException;
import javax.net.ssl.SSLHandshakeException;
import javax.net.ssl.SSLParameters;
import javax.net.ssl.X509ExtendedKeyManager;
import java.io.File;
import java.net.Socket;
import java.nio.ByteBuffer;
import java.security.AlgorithmConstraints;
import java.security.AlgorithmParameters;
import java.security.CryptoPrimitive;
import java.security.Key;
import java.security.KeyStore;
import java.security.Principal;
import java.security.PrivateKey;
import java.security.cert.X509Certificate;
@ -59,7 +55,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import static io.netty.handler.ssl.OpenSslTestUtils.checkShouldUseKeyManagerFactory;
import static io.netty.handler.ssl.ReferenceCountedOpenSslEngine.MAX_PLAINTEXT_LENGTH;

View File

@ -391,7 +391,7 @@ class EpollEventLoop extends SingleThreadEventLoop {
events.increase();
}
} catch (Error e) {
throw (Error) e;
throw e;
} catch (Throwable t) {
handleLoopException(t);
} finally {
@ -404,7 +404,7 @@ class EpollEventLoop extends SingleThreadEventLoop {
}
}
} catch (Error e) {
throw (Error) e;
throw e;
} catch (Throwable t) {
handleLoopException(t);
}

View File

@ -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;

View File

@ -298,7 +298,7 @@ final class KQueueEventLoop extends SingleThreadEventLoop {
eventList.realloc(false);
}
} catch (Error e) {
throw (Error) e;
throw e;
} catch (Throwable t) {
handleLoopException(t);
} finally {
@ -311,7 +311,7 @@ final class KQueueEventLoop extends SingleThreadEventLoop {
}
}
} catch (Error e) {
throw (Error) e;
throw e;
} catch (Throwable t) {
handleLoopException(t);
}

View File

@ -516,7 +516,7 @@ public final class NioEventLoop extends SingleThreadEventLoop {
selector, e);
}
} catch (Error e) {
throw (Error) e;
throw e;
} catch (Throwable t) {
handleLoopException(t);
} finally {
@ -529,7 +529,7 @@ public final class NioEventLoop extends SingleThreadEventLoop {
}
}
} catch (Error e) {
throw (Error) e;
throw e;
} catch (Throwable t) {
handleLoopException(t);
}