From 96a769805bf93d5898da01b746b259998afd26a8 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Fri, 9 Nov 2012 17:44:40 +0900 Subject: [PATCH] Fix utility classes - missing final modifiers etc --- .../io/netty/monitor/MonitorRegistries.java | 4 +-- .../transport/socket/SocketSslEchoTest.java | 25 ++++++++----------- .../io/netty/testsuite/util/TestUtils.java | 4 +-- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/common/src/main/java/io/netty/monitor/MonitorRegistries.java b/common/src/main/java/io/netty/monitor/MonitorRegistries.java index c172b44e86..863a838e96 100644 --- a/common/src/main/java/io/netty/monitor/MonitorRegistries.java +++ b/common/src/main/java/io/netty/monitor/MonitorRegistries.java @@ -47,8 +47,8 @@ public final class MonitorRegistries implements Iterable { return Holder.INSTANCE; } - private static final class Holder { - private static final MonitorRegistries INSTANCE = new MonitorRegistries(); + private interface Holder { + MonitorRegistries INSTANCE = new MonitorRegistries(); } private static final ServiceLoader FACTORIES = ServiceLoader diff --git a/testsuite/src/test/java/io/netty/testsuite/transport/socket/SocketSslEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/SocketSslEchoTest.java index f521916a58..a99530aaaf 100644 --- a/testsuite/src/test/java/io/netty/testsuite/transport/socket/SocketSslEchoTest.java +++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/SocketSslEchoTest.java @@ -15,7 +15,6 @@ */ package io.netty.testsuite.transport.socket; -import static org.junit.Assert.*; import io.netty.bootstrap.Bootstrap; import io.netty.bootstrap.ServerBootstrap; import io.netty.buffer.ByteBuf; @@ -28,7 +27,15 @@ import io.netty.channel.ChannelInboundByteHandlerAdapter; import io.netty.channel.ChannelInitializer; import io.netty.channel.socket.SocketChannel; import io.netty.handler.ssl.SslHandler; +import org.junit.Test; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.ManagerFactoryParameters; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.TrustManager; +import javax.net.ssl.TrustManagerFactorySpi; +import javax.net.ssl.X509TrustManager; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; @@ -42,15 +49,7 @@ import java.util.Random; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; -import javax.net.ssl.KeyManagerFactory; -import javax.net.ssl.ManagerFactoryParameters; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLEngine; -import javax.net.ssl.TrustManager; -import javax.net.ssl.TrustManagerFactorySpi; -import javax.net.ssl.X509TrustManager; - -import org.junit.Test; +import static org.junit.Assert.*; public class SocketSslEchoTest extends AbstractSocketTest { @@ -211,7 +210,7 @@ public class SocketSslEchoTest extends AbstractSocketTest { } } - private static class BogusSslContextFactory { + private static final class BogusSslContextFactory { private static final String PROTOCOL = "TLS"; private static final SSLContext SERVER_CONTEXT; @@ -597,9 +596,5 @@ public class SocketSslEchoTest extends AbstractSocketTest { public static char[] getKeyStorePassword() { return "secret".toCharArray(); } - - private BogusKeyStore() { - // Unused - } } } diff --git a/testsuite/src/test/java/io/netty/testsuite/util/TestUtils.java b/testsuite/src/test/java/io/netty/testsuite/util/TestUtils.java index 0d3338a95a..cd022213eb 100644 --- a/testsuite/src/test/java/io/netty/testsuite/util/TestUtils.java +++ b/testsuite/src/test/java/io/netty/testsuite/util/TestUtils.java @@ -23,7 +23,7 @@ import java.net.ServerSocket; import java.nio.channels.Channel; import java.util.*; -public class TestUtils { +public final class TestUtils { private static final int START_PORT = 32768; private static final int END_PORT = 65536; @@ -109,4 +109,4 @@ public class TestUtils { } private TestUtils() { } -} \ No newline at end of file +}