You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Tony Wu (JIRA)" <ji...@apache.org> on 2007/01/05 08:59:28 UTC

[jira] Commented: (HARMONY-2938) [classlib][luni]no NPE was thrown when send a DatagramPacket with no dest addresss.

    [ https://issues.apache.org/jira/browse/HARMONY-2938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462431 ] 

Tony Wu commented on HARMONY-2938:
----------------------------------

would you please try my patch? thanks a lot!

> [classlib][luni]no NPE was thrown when send a DatagramPacket with no dest addresss.
> -----------------------------------------------------------------------------------
>
>                 Key: HARMONY-2938
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2938
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Tony Wu
>         Attachments: harmony-2938.diff
>
>
> RI throws NPE when send DatagramPacket with no destination address, where harmony return silently.
> testcase below passes on RI whereas fails on harmony,
> public void test_send() throws IOException {
>         InetAddress i = InetAddress.getByName("127.0.0.1");
>         DatagramSocket d = new DatagramSocket(80,i);
>         try{
>             d.send(new DatagramPacket(new byte[]{1}, 1));
>             fail("should throw NPE.");
>         }catch(NullPointerException e){
>             //expected;
>         }finally{
>             d.close();
>         }
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira