Code Review Request: 7035556 DatagramSocket.java:183: warning: unreachable catch clause
Michael McMahon
michael.x.mcmahon at oracle.com
Fri Jul 22 07:25:32 PDT 2011
On 22/07/11 14:55, Alan Bateman wrote:
> Michael McMahon wrote:
>> But, bind() already closes the impl internally before throwing the
>> exception.
> I was wondering about that and whether this is a bug. Suppose someone
> creates an unbound DatagramSocket and then attempts to bind it to a
> port. If the bind fails (say port already in use) then it may be
> surprising that they can't retry with a different port. Should this
> be specified? I see there are cases such as the security exception
> where it doesn't the close the impl.
>
> -Alan.
It doesn't seem to be specified either way, though it does seem to be
inconsistent.
I'd be wary about changing the behaviour though
unless there was a strong justification (more than a compiler warning :) )
- Michael.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/net-dev/attachments/20110722/d2eb6564/attachment.html
More information about the net-dev
mailing list