|
disconnect should not be called on a SocketClient instance that has not
been successfully connected. If there's a problem, it would be with the unit test, not SocketClient. In other words, the test code should be if(client.isConnected()) client.disconnect(); instead of client.disconnect(); However, if you do that, then the unit test doesn't fail when a connection But since client.disconnect() already throws an exception, I have to assume In short, the test is supposed to fail if it can't connect. (In reply to comment #1)
> This patch solves the problem. I'm going to go ahead with packaging 1.4.1 using > this patch, unless there's some overwhelming reason not to. I don't mean to speak for the rest of the Commons Net developers, but I think (In reply to comment #2) Fair enough. However, I think that some exception should be thrown (maybe > (In reply to comment #3) I concurr about not including the patch. We actually prefer to keep packages as > Applying your patch may cause more bug reports from people who call disconnect() The current code doesn't give much better of an indication that something went I changed the test to check isConnected before calling disconnect. My With regard to SocketClient, I have no objection to making disconnect throw My only comment here is that you've patched the head which is not the same as
patching version 1.4.1. This is exactly the right thing to have done, I am not criticizing at all but I just want to clarify this point since the summary mentions 1.4.1 specifically. Version 1.4.1 was handled as a BRANCH off 1.4.0, rather than the usual release I mainly bring this up because we're probably approaching the point where we |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
commons-net-1.4.1-socketclient.patch
This patch solves the problem. I'm going to go ahead with packaging 1.4.1 using
this patch, unless there's some overwhelming reason not to.