Skip to content

Commit

Permalink
Remove useless imports and redundant type cast (netty#11639)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
skyguard1 authored and laosijikaichele committed Dec 16, 2021
1 parent 6ce497b commit 86ac45d
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 14 deletions.
Expand Up @@ -82,7 +82,7 @@ public static MqttMessage newMessage(MqttFixedHeader mqttFixedHeader, Object var
case AUTH:
//Having MqttReasonCodeAndPropertiesVariableHeader
return new MqttMessage(mqttFixedHeader,
(MqttReasonCodeAndPropertiesVariableHeader) variableHeader);
variableHeader);

default:
throw new IllegalArgumentException("unknown message type: " + mqttFixedHeader.messageType());
Expand Down
Expand Up @@ -48,7 +48,6 @@
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;
Expand Down
Expand Up @@ -25,7 +25,6 @@
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;
Expand All @@ -36,30 +35,26 @@
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;
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;
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;
Expand Down
Expand Up @@ -391,7 +391,7 @@ protected void run() {
events.increase();
}
} catch (Error e) {
throw (Error) e;
throw e;
} catch (Throwable t) {
handleLoopException(t);
} finally {
Expand All @@ -404,7 +404,7 @@ protected void run() {
}
}
} catch (Error e) {
throw (Error) e;
throw e;
} catch (Throwable t) {
handleLoopException(t);
}
Expand Down
Expand Up @@ -17,7 +17,6 @@

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;

Expand Down
Expand Up @@ -298,7 +298,7 @@ protected void run() {
eventList.realloc(false);
}
} catch (Error e) {
throw (Error) e;
throw e;
} catch (Throwable t) {
handleLoopException(t);
} finally {
Expand All @@ -311,7 +311,7 @@ protected void run() {
}
}
} catch (Error e) {
throw (Error) e;
throw e;
} catch (Throwable t) {
handleLoopException(t);
}
Expand Down
Expand Up @@ -516,7 +516,7 @@ protected void run() {
selector, e);
}
} catch (Error e) {
throw (Error) e;
throw e;
} catch (Throwable t) {
handleLoopException(t);
} finally {
Expand All @@ -529,7 +529,7 @@ protected void run() {
}
}
} catch (Error e) {
throw (Error) e;
throw e;
} catch (Throwable t) {
handleLoopException(t);
}
Expand Down

0 comments on commit 86ac45d

Please sign in to comment.