Uploaded image for project: 'Commons JCS'
  1. Commons JCS
  2. JCS-108

incorrect equivalence judgement in BlockDisk.write(long, byte[])

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • jcs-2.0-beta-1
    • None
    • None

    Description

      In the trunk, BlockDisk.write(long, byte[]) is as follows:

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

      where the return statement should be:

              return written == data.length + HEADER_SIZE_BYTES;
      

      Attachments

        Activity

          People

            tv Thomas Vandahl
            liuxiong Xiong LIU
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: