Michael Koch wrote:
Hi list,
I commited the attached big patch to fix several issues in the socket
stuff. This mainly adds checks to many methods to see if the socket is
closed already.
I like the patch, though I'm not a gcj developer. I have one small nit
to pick, though. Instead of copying
if (isClosed())
throw new SocketException("socket is closed");
so many times, you could have used a private method to do the checking
and throwing.
checkIfIsClosed();
private void checkIfIsClosed() throws SocketException {
if (isClosed())
throw new SocketException("socket is closed");
}
Code duplication is evil ;)