From 8b655575e1ba31743aec29d27044a92c1fd4bc79 Mon Sep 17 00:00:00 2001 From: Amos Ng Date: Tue, 16 Jun 2020 11:50:29 +0800 Subject: [PATCH] Applied spotlessJava --- src/main/java/mdnet/cache/DiskLruCache.java | 9 ++++++--- src/main/kotlin/mdnet/base/Netty.kt | 9 +++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/java/mdnet/cache/DiskLruCache.java b/src/main/java/mdnet/cache/DiskLruCache.java index 896e160..72dd114 100644 --- a/src/main/java/mdnet/cache/DiskLruCache.java +++ b/src/main/java/mdnet/cache/DiskLruCache.java @@ -410,7 +410,8 @@ public final class DiskLruCache implements Closeable { /** * Returns a snapshot of the entry named {@code key}, or null if it doesn't * exist is not currently readable. If a value is returned, it is moved to the - * head of the LRU queue. Unsafe as it allows arbitrary directories to be accessed! + * head of the LRU queue. Unsafe as it allows arbitrary directories to be + * accessed! */ public Snapshot getUnsafe(String key) throws IOException { validateUnsafeKey(key); @@ -611,7 +612,8 @@ public final class DiskLruCache implements Closeable { /** * Drops the entry for {@code key} if it exists and can be removed. Entries - * actively being edited cannot be removed. Unsafe as it allows arbitrary directories to be accessed! + * actively being edited cannot be removed. Unsafe as it allows arbitrary + * directories to be accessed! * * @return true if an entry was removed. */ @@ -707,7 +709,8 @@ public final class DiskLruCache implements Closeable { private void validateUnsafeKey(String key) { Matcher matcher = UNSAFE_LEGAL_KEY_PATTERN.matcher(key); if (!matcher.matches()) { - throw new IllegalArgumentException("Unsafe keys must match regex " + UNSAFE_LEGAL_KEY_PATTERN + ": \"" + key + "\""); + throw new IllegalArgumentException( + "Unsafe keys must match regex " + UNSAFE_LEGAL_KEY_PATTERN + ": \"" + key + "\""); } } diff --git a/src/main/kotlin/mdnet/base/Netty.kt b/src/main/kotlin/mdnet/base/Netty.kt index 6addec2..b8d089d 100644 --- a/src/main/kotlin/mdnet/base/Netty.kt +++ b/src/main/kotlin/mdnet/base/Netty.kt @@ -1,7 +1,13 @@ package mdnet.base import io.netty.bootstrap.ServerBootstrap -import io.netty.channel.* +import io.netty.channel.ChannelFactory +import io.netty.channel.ChannelFuture +import io.netty.channel.ChannelHandlerContext +import io.netty.channel.ChannelInboundHandlerAdapter +import io.netty.channel.ChannelInitializer +import io.netty.channel.ChannelOption +import io.netty.channel.ServerChannel import io.netty.channel.nio.NioEventLoopGroup import io.netty.channel.socket.SocketChannel import io.netty.channel.socket.nio.NioServerSocketChannel @@ -11,7 +17,6 @@ import io.netty.handler.codec.http.HttpServerCodec import io.netty.handler.codec.http.HttpServerKeepAliveHandler import io.netty.handler.ssl.SslContextBuilder import io.netty.handler.stream.ChunkedWriteHandler -import io.netty.handler.timeout.IdleStateHandler import io.netty.handler.traffic.GlobalTrafficShapingHandler import io.netty.handler.traffic.TrafficCounter import mdnet.base.settings.ClientSettings