harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ray Chen (JIRA)" <j...@apache.org>
Subject [jira] Closed: (HARMONY-6411) [classlib][luni]DatagramSock do NOT throw Exception
Date Mon, 08 Feb 2010 07:29:28 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-6411?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ray Chen closed HARMONY-6411.
-----------------------------

       Resolution: Fixed
    Fix Version/s: 5.0M13

Please refer to JIRA-6412 and JIRA-6413

> [classlib][luni]DatagramSock do NOT throw Exception
> ---------------------------------------------------
>
>                 Key: HARMONY-6411
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6411
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ray Chen
>             Fix For: 5.0M13
>
>
> Run following simple test case, got different results from RI:
> public static void main(String[] args) throws SocketException, IOException {
>         InetSocketAddress sa = InetSocketAddress.createUnresolved("localhost",0);
>         new DatagramSocket().send(new DatagramPacket(new byte[272], 3, sa));
> }
> RI 5:
> Exception in thread "main" java.lang.NullPointerException: null address || null buffer
>         at java.net.PlainDatagramSocketImpl.send(Native Method)
>         at java.net.DatagramSocket.send(DatagramSocket.java:612)
>         at DST2.main(DST2.java:10)
> Harmony 5:   No Exception
> RI 6:
> Exception in thread "main" java.lang.IllegalArgumentException: unresolved address
>         at java.net.DatagramPacket.setSocketAddress(DatagramPacket.java:295)
>         at java.net.DatagramPacket.<init>(DatagramPacket.java:123)
>         at java.net.DatagramPacket.<init>(DatagramPacket.java:158)
>         at DST2.main(DST2.java:10)
> Harmony 6:  No Exception
> According to the spec, InetSocketAddress.createUnresolved() says "A port number of zero
will let the system pick up an ephemeral port in a bind operation."
> But DatagramPacket just says "throws IllegalArgumentException - if address type is not
supported"
> Harmony's behavior should be as same as RI's

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message