Optimized code
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
ehlxr 2021-03-04 11:24:45 +08:00
parent 0df36ea686
commit 88bdd43e72
7 changed files with 5 additions and 14 deletions

View File

@ -37,8 +37,8 @@ import java.util.Objects;
* @since 2021-02-08 22:12. * @since 2021-02-08 22:12.
*/ */
public final class SerializerHolder { public final class SerializerHolder {
private volatile static Serializer serializer = null;
private static final Logger logger = LoggerFactory.getLogger(SerializerHolder.class); private static final Logger logger = LoggerFactory.getLogger(SerializerHolder.class);
private volatile static Serializer serializer = null;
private SerializerHolder() { private SerializerHolder() {
} }

View File

@ -28,17 +28,9 @@ import com.caucho.hessian.io.HessianInput;
import com.caucho.hessian.io.HessianOutput; import com.caucho.hessian.io.HessianOutput;
import io.github.ehlxr.did.common.Try; import io.github.ehlxr.did.common.Try;
import io.github.ehlxr.did.serializer.Serializer; import io.github.ehlxr.did.serializer.Serializer;
import io.protostuff.LinkedBuffer;
import io.protostuff.ProtostuffIOUtil;
import io.protostuff.Schema;
import io.protostuff.runtime.RuntimeSchema;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/** /**
* @author ehlxr * @author ehlxr

View File

@ -29,7 +29,6 @@ import io.github.ehlxr.did.adapter.Message;
import io.github.ehlxr.did.client.Client; import io.github.ehlxr.did.client.Client;
import io.github.ehlxr.did.client.ResponseFuture; import io.github.ehlxr.did.client.ResponseFuture;
import io.github.ehlxr.did.common.NettyUtil; import io.github.ehlxr.did.common.NettyUtil;
import io.github.ehlxr.did.common.Try;
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler; import io.netty.channel.SimpleChannelInboundHandler;
import org.slf4j.Logger; import org.slf4j.Logger;

View File

@ -24,8 +24,8 @@
package io.github.ehlxr.did.server; package io.github.ehlxr.did.server;
import io.github.ehlxr.did.generator.SnowFlake;
import io.github.ehlxr.did.common.Try; import io.github.ehlxr.did.common.Try;
import io.github.ehlxr.did.generator.SnowFlake;
import io.netty.bootstrap.ServerBootstrap; import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelOption; import io.netty.channel.ChannelOption;

View File

@ -24,9 +24,9 @@
package io.github.ehlxr.did.server.http; package io.github.ehlxr.did.server.http;
import io.github.ehlxr.did.generator.SnowFlake;
import io.github.ehlxr.did.common.Constants; import io.github.ehlxr.did.common.Constants;
import io.github.ehlxr.did.common.Try; import io.github.ehlxr.did.common.Try;
import io.github.ehlxr.did.generator.SnowFlake;
import io.github.ehlxr.did.server.BaseServer; import io.github.ehlxr.did.server.BaseServer;
import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.SocketChannel;

View File

@ -25,10 +25,10 @@
package io.github.ehlxr.did.server.http; package io.github.ehlxr.did.server.http;
import io.github.ehlxr.did.SdkProto; import io.github.ehlxr.did.SdkProto;
import io.github.ehlxr.did.generator.SnowFlake;
import io.github.ehlxr.did.common.Constants; import io.github.ehlxr.did.common.Constants;
import io.github.ehlxr.did.common.NettyUtil; import io.github.ehlxr.did.common.NettyUtil;
import io.github.ehlxr.did.common.Result; import io.github.ehlxr.did.common.Result;
import io.github.ehlxr.did.generator.SnowFlake;
import io.netty.channel.Channel; import io.netty.channel.Channel;
import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelHandlerContext;

View File

@ -24,11 +24,11 @@
package io.github.ehlxr.did.server.sdk; package io.github.ehlxr.did.server.sdk;
import io.github.ehlxr.did.generator.SnowFlake;
import io.github.ehlxr.did.adapter.MessageDecoder; import io.github.ehlxr.did.adapter.MessageDecoder;
import io.github.ehlxr.did.adapter.MessageEncoder; import io.github.ehlxr.did.adapter.MessageEncoder;
import io.github.ehlxr.did.common.Constants; import io.github.ehlxr.did.common.Constants;
import io.github.ehlxr.did.common.Try; import io.github.ehlxr.did.common.Try;
import io.github.ehlxr.did.generator.SnowFlake;
import io.github.ehlxr.did.server.BaseServer; import io.github.ehlxr.did.server.BaseServer;
import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.SocketChannel;