harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Zhang (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-960) [classlib][nio]FileChannelImpl.write(ByteBuffer[] buffers, int offset, int length) checks wrong range.
Date Mon, 24 Jul 2006 09:30:14 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-960?page=all ]

Andrew Zhang updated HARMONY-960:
---------------------------------

    Attachment: nio.diff

Hello,

    The patch also refactor to refine the implementation:
origin:
...
complete = true;
try{
}catch(Exception1 e){
   complete = false;
   throw e
}catch(Exception1 e){
   complete = false;
   throw e
} finally {}
...
refactored:
...
complete = false;
try{
   ...
   complete = true;
}finally {}
...

    Would you please try my patch?

Thanks!

Best regards,
Andrew

> [classlib][nio]FileChannelImpl.write(ByteBuffer[] buffers, int offset, int length) checks
wrong range.
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-960
>                 URL: http://issues.apache.org/jira/browse/HARMONY-960
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Andrew Zhang
>         Attachments: nio.diff
>
>
> Hello,
>     FileChannelImpl.write(ByteBuffer[] buffers, int offset, int length) contains a bug.
It should write all buffers whose offset is larger than(equals to) the given offset and less
than length plus offset. Currently, it uses length instead of length plus offset.
>     It is in line: 628
> write(ByteBuffer[] buffers, int offset, int length){
>    ......
>     for (int i = offset; i < length; i++) // must be " i < length + offset"
>    ......
> }

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