On 7/19/06, Paulex Yang <[EMAIL PROTECTED]> wrote:
I tried the test, and it failed as you said with RI on my WinXP. And I also tried to pass in a read/write FileChannel got from RandomAccessFile, the test passes. I consider this is RI's bug, because no way to have such different behavior in this clear test. So I think we should follow spec.
I agree that this is RI bug. RandomAccessFile("rw") works OK because the channel is writable and can be extended by map() method. FileInputStream or RandomAccessFile("r") returns redable channel and we get 'Access Is Denied" when map() tries to change its size. The description of such a process could be found here: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6416884 , see item 2 in evaludation. + I examined Sun's bug database I have not found any bug like this reported before. + Note, that this test is failed even with writable source channel: the 'result' is 2*length -- Mikhail Fursov