harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Loenko (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HARMONY-541) [classlib][nio-channels]java.nio.channels.SocketChannel.write(ByteBuffer) may cause an IllegalArgumentException
Date Fri, 02 Jun 2006 09:48:31 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-541?page=all ]
     
Mikhail Loenko resolved HARMONY-541:
------------------------------------

    Resolution: Duplicate

see comment from the reporter

> [classlib][nio-channels]java.nio.channels.SocketChannel.write(ByteBuffer) may cause an
IllegalArgumentException
> ---------------------------------------------------------------------------------------------------------------
>
>          Key: HARMONY-541
>          URL: http://issues.apache.org/jira/browse/HARMONY-541
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Paulex Yang
>     Priority: Minor

>
> java.nio.channels.SocketChannel.write(ByteBuffer) causes an IllegalArgumentException
if the given buffer's position is not zero. The test case below reproduces this bug:
> public void test_socketChannel_write() throws Exception {
>         final String testStr = "Hello World";
>         ByteBuffer readBuf = ByteBuffer.allocate(11);
>         ByteBuffer buf = ByteBuffer.wrap(testStr.getBytes());
>         ServerSocketChannel ssc = ServerSocketChannel.open();
>         ssc.socket().bind(new InetSocketAddress(InetAddress.getLocalHost(),50001));
>         SocketChannel sc = SocketChannel.open();
>         sc.connect(new InetSocketAddress(InetAddress.getLocalHost(),50001));
>         buf.position(2);
>         ssc.accept().write(buf);
>         assertEquals(9,sc.read(readBuf));
>     }
> RI 5.0 passes the test, however Harmony fails with an IllegalArgumentException in "ssc.accept().write(buf);"

-- 
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