Hi Patrick,

I think this looks OK.

I might suggest using assertThrows vs expectThrows.  While they are the same,  
assertThrows seems more natural and consistent with the other testNG assert 
methods.

HTH

Best
Lance

> On Mar 31, 2020, at 6:15 AM, Patrick Concannon <patrick.concan...@oracle.com> 
> wrote:
> 
> Hi,
> 
> Could someone please review my fix for JDK-8240533 'Inconsistent Exceptions 
> are thrown by DatagramSocket and DatagramChannel when sending a 
> DatagramPacket to port 0.' ?
> 
> Currently, DatagramSocket throws an IOException when sending to port 0, and 
> doesn't throw when connecting. DatagramChannel currently throws a 
> BindException in both cases.
> The fix adds checks for port == 0 to the send and connect methods in 
> DatagramSocket and DatagramChannelImpl. This is to ensure that consistent 
> Exceptions i.e. SocketExceptions are thrown when trying to connect or send to 
> port 0.
> 
> 
> bug: https://bugs.openjdk.java.net/browse/JDK-8240533
> webrev: http://cr.openjdk.java.net/~pconcannon/8240533/webrevs/webrev.00/
> 
> 
> Kind regards,
> 
> Patrick

 <http://oracle.com/us/design/oracle-email-sig-198324.gif>
 <http://oracle.com/us/design/oracle-email-sig-198324.gif> 
<http://oracle.com/us/design/oracle-email-sig-198324.gif>
 <http://oracle.com/us/design/oracle-email-sig-198324.gif>Lance Andersen| 
Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering 
1 Network Drive 
Burlington, MA 01803
lance.ander...@oracle.com <mailto:lance.ander...@oracle.com>



Reply via email to