Fix some low-hanging code quality issue fruits (#1047)

* Fix some low-hanging code quality issue fruits

These include problems such as: use of raw types, unnecessary throw clauses,
unused variables, and more.
This commit is contained in:
Ben McIlwain 2021-04-01 18:04:21 -04:00 committed by GitHub
parent dc51019fd2
commit 0164bceb95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
79 changed files with 163 additions and 196 deletions

View file

@ -154,7 +154,7 @@ public abstract class ProtocolModuleTest {
new EmbeddedChannel(
new ChannelInitializer<Channel>() {
@Override
protected void initChannel(Channel ch) throws Exception {
protected void initChannel(Channel ch) {
initializer.accept(ch);
}
});

View file

@ -81,7 +81,7 @@ class BackendMetricsHandlerTest {
new EmbeddedChannel(
new ChannelInitializer<EmbeddedChannel>() {
@Override
protected void initChannel(EmbeddedChannel ch) throws Exception {
protected void initChannel(EmbeddedChannel ch) {
ch.attr(PROTOCOL_KEY).set(backendProtocol);
ch.attr(RELAY_CHANNEL_KEY).set(frontendChannel);
ch.pipeline().addLast(handler);

View file

@ -82,8 +82,8 @@ class EppServiceHandlerTest {
private EmbeddedChannel channel;
private void setHandshakeSuccess(EmbeddedChannel channel, X509Certificate certificate)
throws Exception {
private void setHandshakeSuccess(EmbeddedChannel channel, X509Certificate certificate) {
@SuppressWarnings("unused")
Promise<X509Certificate> unusedPromise =
channel.attr(CLIENT_CERTIFICATE_PROMISE_KEY).get().setSuccess(certificate);
}
@ -92,7 +92,7 @@ class EppServiceHandlerTest {
setHandshakeSuccess(channel, clientCertificate);
}
private void setHandshakeFailure(EmbeddedChannel channel) throws Exception {
private void setHandshakeFailure(EmbeddedChannel channel) {
Promise<X509Certificate> unusedPromise =
channel
.attr(CLIENT_CERTIFICATE_PROMISE_KEY)
@ -135,12 +135,12 @@ class EppServiceHandlerTest {
channel = setUpNewChannel(eppServiceHandler);
}
private EmbeddedChannel setUpNewChannel(EppServiceHandler handler) throws Exception {
private EmbeddedChannel setUpNewChannel(EppServiceHandler handler) {
return new EmbeddedChannel(
DefaultChannelId.newInstance(),
new ChannelInitializer<EmbeddedChannel>() {
@Override
protected void initChannel(EmbeddedChannel ch) throws Exception {
protected void initChannel(EmbeddedChannel ch) {
ch.attr(REMOTE_ADDRESS_KEY).set(CLIENT_ADDRESS);
ch.attr(CLIENT_CERTIFICATE_PROMISE_KEY).set(ch.eventLoop().newPromise());
ch.pipeline().addLast(handler);

View file

@ -61,7 +61,7 @@ class FrontendMetricsHandlerTest {
new EmbeddedChannel(
new ChannelInitializer<EmbeddedChannel>() {
@Override
protected void initChannel(EmbeddedChannel ch) throws Exception {
protected void initChannel(EmbeddedChannel ch) {
ch.attr(PROTOCOL_KEY).set(frontendProtocol);
ch.attr(CLIENT_CERTIFICATE_HASH_KEY).set(CLIENT_CERT_HASH);
ch.pipeline().addLast(handler);

View file

@ -67,7 +67,7 @@ class QuotaManagerTest {
}
@Test
void testSuccess_rebate() throws Exception {
void testSuccess_rebate() {
DateTime grantedTokenRefillTime = clock.nowUtc();
response = QuotaResponse.create(true, USER_ID, grantedTokenRefillTime);
QuotaRebate rebate = QuotaRebate.create(response);