[
https://issues.apache.org/jira/browse/JCS-108?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Thomas Vandahl resolved JCS-108.
--------------------------------
Resolution: Fixed
Fix Version/s: jcs-2.0.0
Assignee: Thomas Vandahl
Fixed in SVN
> incorrect equivalence judgement in BlockDisk.write(long, byte[])
> ----------------------------------------------------------------
>
> Key: JCS-108
> URL: https://issues.apache.org/jira/browse/JCS-108
> Project: Commons JCS
> Issue Type: Bug
> Reporter: Xiong LIU
> Assignee: Thomas Vandahl
> Fix For: jcs-2.0.0
>
>
> In the trunk, BlockDisk.write(long, byte[]) is as follows:
> {code}
> private boolean write( long position, byte[] data )
> throws IOException
> {
> ByteBuffer buffer = ByteBuffer.allocate(HEADER_SIZE_BYTES +
> data.length);
> buffer.putInt(data.length);
> buffer.put(data);
> buffer.flip();
> int written = fc.write(buffer, position);
> fc.force(true);
> return written == data.length;
> }
> {code}
> where the return statement should be:
> {code}
> return written == data.length + HEADER_SIZE_BYTES;
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira