You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Xiong LIU (JIRA)" <ji...@apache.org> on 2013/09/24 13:01:02 UTC
[jira] [Created] (JCS-108) incorrect equivalence judgement in
BlockDisk.write(long, byte[])
Xiong LIU created JCS-108:
-----------------------------
Summary: 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
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