From 2c99fda7b57123a4df03c6fa6e1e1f7a76337285 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Wed, 16 May 2012 23:07:19 +0900 Subject: [PATCH] Remove unnecessary field --- .../channel/socket/nio/NioServerSocketChannel.java | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/transport/src/main/java/io/netty/channel/socket/nio/NioServerSocketChannel.java b/transport/src/main/java/io/netty/channel/socket/nio/NioServerSocketChannel.java index 68773515d9..67d063d38b 100644 --- a/transport/src/main/java/io/netty/channel/socket/nio/NioServerSocketChannel.java +++ b/transport/src/main/java/io/netty/channel/socket/nio/NioServerSocketChannel.java @@ -37,7 +37,6 @@ public class NioServerSocketChannel extends AbstractServerChannel private final ServerSocketChannel socket; private final ServerSocketChannelConfig config; - private volatile InetSocketAddress localAddress; private volatile SelectionKey selectionKey; public NioServerSocketChannel() { @@ -81,17 +80,7 @@ public class NioServerSocketChannel extends AbstractServerChannel @Override public InetSocketAddress localAddress() { - InetSocketAddress localAddress = this.localAddress; - if (localAddress == null) { - try { - this.localAddress = localAddress = - (InetSocketAddress) unsafe().localAddress(); - } catch (Throwable t) { - // Sometimes fails on a closed socket in Windows. - return null; - } - } - return localAddress; + return (InetSocketAddress) super.localAddress(); } @Override