I just meant that the discussion (on the Java board) included an incorrect testcase, since the code should not have worked according to the specification.

It may still be relevant, I was just pointing out that it is suspect.

Unless the bug has been posted & verified in the Java Bug Database, I find most "user reports" to not be valid, and usually their "bug" is caused by incorrect code.


On Jan 8, 2007, at 11:10 PM, Doron Cohen wrote:

robert engels <[EMAIL PROTECTED]> wrote on 08/01/2007 17:39:45:

The Java discussion that is cited is not valid (at least in terms of
the test case provided).

... right ... that discussion really is irrelevant - I read that too quick,
sorry for that.


The javadoc for RandomAccessFile states:

/**
      * Sets the file-pointer offset, measured from the beginning of
this
* file, at which the next read or write occurs. The offset may be
      * set beyond the end of the file. Setting the offset beyond the
end
      * of the file does not change the file length.  The file length
will
      * change only by writing after the offset has been set beyond
the end
      * of the file.

so the seeking does not affect the file length, meaning that all of
the lengths should be 0.

But since both of these methods are native, there is the real
possibility that some JVM or OS combination is not adhering to the
specification.

Actually I don't see any use of RandomAccessFile.setLength() in Lucene so
this is not an issue.

...I think I now remember what it was - File.length() -
http://forum.java.sun.com/thread.jspa?forumID=31&threadID=262446 That was while ago - jre 1.3 - I saw this also with jre 1.4, but not yet with 1.5.
But - again - it is randomAccessFile.length() used in Lucene, not
File.length()... So I am not sure what the conclusion should be.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to