Applied spotlessJava

This commit is contained in:
Amos Ng 2020-06-16 11:50:29 +08:00
parent d27cd91947
commit 8b655575e1
No known key found for this signature in database
GPG key ID: 89086414F634D123
2 changed files with 13 additions and 5 deletions

View file

@ -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 + "\"");
}
}

View file

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