Code Review Request: 6978200 ServerSocket.toString include "port=0" in the returned String

Alan Bateman Alan.Bateman at oracle.com
Thu Jul 28 20:01:01 PDT 2011


Kurchi Hazra wrote:
> Hi,
>
>   The ServerSocket.toString method returns a string that, besides the 
> ServerSocket's local port information, also contains "port=0". For 
> example: "ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=7005]".
>
> The fix aims at modifying the string returned by the toString method 
> by removing impl.getPort() from the method and subsequently "port=0" 
> from it. 
This make sense as it's only the local port that is interesting. The 
change looks good to me.

-Alan



More information about the net-dev mailing list