java.net.Socket: When a socket is closed impl is set to null. However, some methods use getImpl() without checking for isClosed() first. In particular: - isConnected() will throw NullPointerException if called on a closed socket. Hence so will - getPort - getInetAddress - getRemoteSocketAddress - toString - getLocalAddress() will throw NullPointerException if called on a closed socket. - setReuseAddress() will throw NullPointerException if called on a closed socket.
Fixed by the following patch: 2004-07-17 Michael Koch <konqueror@gmx.de> * java/net/DatagramSocket.java (getLocalAddress): Check if socket is bound or not. * java/net/Socket.java (getLocalAddrss): Check if socket is bound or not. (getPort): Return -1 when not connected. Dont check getImpl() for null. (setReuseAddress): Check if socket is closed. (isConnected): Check if getImpl() returns null.