commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 37985] - [net] Unit tests fail for commons-net-1.4.1 with NullPointerException
Date Fri, 23 Dec 2005 21:30:06 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37985>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37985


dfs@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From dfs@apache.org  2005-12-23 22:30 -------

I changed the test to check isConnected before calling disconnect.  My
original statement about what the original test writer probably intended
was incorrect.  connect() throws an exception when it fails.  The lack
of any catch block indicates the test writer intended for the original
exception to pass through.  However, in that context--by placing the
disconnect in a finally block--it is incorrect for the test to call
disconnect without first checking isConnected.  Sorry for my original
misdiagnosis.

With regard to SocketClient, I have no objection to making disconnect throw
an IllegalStateException if that is where the consensus of the Commons Net
user and developer community has moved.  However, that would be an
enhancement request and should be discussed on the commons-dev mailing
list first.  The reason an  IllegalStateException is not thrown is because
the library was designed with the philosophy of not checking every possible
API misuse and throwing an exception in each case.  Doing so would have
littered the code with a lot of if then else throw sequences, making the
API throw even more exceptions than it already does.  The consensus in the
past has been to not check every possible mistake in API use.  However,
that consensus can be retested on commons-dev.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message