harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Ellison (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HARMONY-701) [classlib][nio] java.nio.channels.DatagramChannel.send(ByteBuffer, SocketAddress) sends data incorrectly if the position of ByteBuffer is not zero.
Date Mon, 03 Jul 2006 10:56:30 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-701?page=all ]
     
Tim Ellison resolved HARMONY-701:
---------------------------------

    Resolution: Fixed

Thanks Andrew.

Patch applied to NIO module at repo revision r418741.

Please check that the patch was applied as you expected.


> [classlib][nio] java.nio.channels.DatagramChannel.send(ByteBuffer, SocketAddress) sends
data incorrectly if the position of ByteBuffer is not zero.
> ---------------------------------------------------------------------------------------------------------------------------------------------------
>
>          Key: HARMONY-701
>          URL: http://issues.apache.org/jira/browse/HARMONY-701
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Andrew Zhang
>     Assignee: Tim Ellison
>  Attachments: nio.diff
>
> java.nio.channels.DatagramChannel.send(ByteBuffer, SocketAddress) sends data incorrectly
if the position of ByteBuffer is not zero.
> Following test case reproduces the bug. 
> I'll upload a patch soon. Thanks! 
> Test case:
>     public void test_send_LBuffer_LSocketAddress_PositionNotZero()  throws Exception
{
>         int CAPACITY_NORMAL = 256;
>         int postion = 16;
>         DatagramChannel dc = DatagramChannel.open();
>         SocketAddress addr = new InetSocketAddress("127.0.0.1", 50000);
>         byte[] sourceArray = new byte[CAPACITY_NORMAL];
>         // send ByteBuffer whose position is not zero
>         ByteBuffer sourceBuf = ByteBuffer.wrap(sourceArray);
>         sourceBuf.position(postion);
>         assertEquals(CAPACITY_NORMAL - postion, dc.send(sourceBuf, addr));
>     }
> Test result:
> RI 5.0 passes the test while Harmony fails. 
> Best regards,
> Andrew

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


Mime
View raw message