diff --git a/proxy/frontend/core/src/main/java/org/apache/shardingsphere/proxy/frontend/CDCServer.java b/proxy/frontend/core/src/main/java/org/apache/shardingsphere/proxy/frontend/CDCServer.java index a435fa18d1469..15023e3c4ec4f 100644 --- a/proxy/frontend/core/src/main/java/org/apache/shardingsphere/proxy/frontend/CDCServer.java +++ b/proxy/frontend/core/src/main/java/org/apache/shardingsphere/proxy/frontend/CDCServer.java @@ -78,11 +78,11 @@ private List startInternal(final List addresses, final in .childOption(ChannelOption.TCP_NODELAY, true) .handler(new LoggingHandler(LogLevel.INFO)) .childHandler(new CDCServerHandlerInitializer()); - List futures = new ArrayList<>(); - for (String address : addresses) { - futures.add(bootstrap.bind(address, port).sync()); + List result = new ArrayList<>(); + for (String each : addresses) { + result.add(bootstrap.bind(each, port).sync()); } - return futures; + return result; } private void createEventLoopGroup() { diff --git a/proxy/frontend/core/src/main/java/org/apache/shardingsphere/proxy/frontend/ShardingSphereProxy.java b/proxy/frontend/core/src/main/java/org/apache/shardingsphere/proxy/frontend/ShardingSphereProxy.java index 5622e84cc2212..5dd39ef6a3ed5 100644 --- a/proxy/frontend/core/src/main/java/org/apache/shardingsphere/proxy/frontend/ShardingSphereProxy.java +++ b/proxy/frontend/core/src/main/java/org/apache/shardingsphere/proxy/frontend/ShardingSphereProxy.java @@ -68,7 +68,7 @@ private EventLoopGroup getWorkerGroup() { /** * Start ShardingSphere-Proxy. * - * @param port port + * @param port port * @param addresses addresses */ @SneakyThrows(InterruptedException.class) @@ -104,11 +104,11 @@ public void start(final String socketPath) { private List startInternal(final int port, final List addresses) throws InterruptedException { ServerBootstrap bootstrap = new ServerBootstrap(); initServerBootstrap(bootstrap); - List futures = new ArrayList<>(); - for (String address : addresses) { - futures.add(bootstrap.bind(address, port).sync()); + List result = new ArrayList<>(); + for (String each : addresses) { + result.add(bootstrap.bind(each, port).sync()); } - return futures; + return result; } private ChannelFuture startDomainSocket(final String socketPath) { @@ -119,8 +119,8 @@ private ChannelFuture startDomainSocket(final String socketPath) { private void accept(final List futures) throws InterruptedException { log.info("ShardingSphere-Proxy {} mode started successfully", ProxyContext.getInstance().getContextManager().getInstanceContext().getModeConfiguration().getType()); - for (ChannelFuture future : futures) { - future.channel().closeFuture().sync(); + for (ChannelFuture each : futures) { + each.channel().closeFuture().sync(); } }