diff -r 74aeb4741e3d -r 22f8c33b0690 jdk/src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java --- a/jdk/src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java Thu Mar 28 06:55:42 2013 -0400 +++ b/jdk/src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java Thu Mar 28 14:34:18 2013 -0700 @@ -72,7 +72,7 @@ private int state = ST_UNINITIALIZED; // Binding - private SocketAddress localAddress; // null => unbound + private InetSocketAddress localAddress; // null => unbound // set true when exclusive binding is on and SO_REUSEADDR is emulated private boolean isReuseAddress; @@ -116,7 +116,9 @@ synchronized (stateLock) { if (!isOpen()) throw new ClosedChannelException(); - return localAddress; + return localAddress == null ? localAddress + : Net.getRevealedLocalAddress( + Net.asInetSocketAddress(localAddress)); } } @@ -190,7 +192,7 @@ } } - public SocketAddress localAddress() { + public InetSocketAddress localAddress() { synchronized (stateLock) { return localAddress; } @@ -384,14 +386,15 @@ StringBuffer sb = new StringBuffer(); sb.append(this.getClass().getName()); sb.append('['); - if (!isOpen()) + if (!isOpen()) { sb.append("closed"); - else { + } else { synchronized (stateLock) { - if (localAddress() == null) { + InetSocketAddress addr = localAddress(); + if (addr == null) { sb.append("unbound"); } else { - sb.append(localAddress().toString()); + sb.append(Net.getRevealedLocalAddressAsString(addr)); } } }