RFR 8204310 : Simpler RandomAccessFile.setLength() on Windows

Ivan Gerasimov ivan.gerasimov at oracle.com
Thu Jun 7 08:12:54 UTC 2018


Hi Alan!


On 6/6/18 6:57 AM, Alan Bateman wrote:
> I think this should be okay but the Windows implementation has a long 
> history of biting the fingers of anyone that dares touch it. Sometimes 
> unexpected behavior changes only come to light long after the change. 
> The recent mails here about Kafka and sparse files is a good example 
> of that. So I think it's important to check the test coverage before 
> pushing this change. Specifically I think we need to check that we 
> have tests that
>
> 1. Exercise shrinking, extending, and not change the file length
>
> 2. Check getFilePointer when used with setLength.
>
> 3. Check how FileChannel behaves when created from a RandomAccessFile 
> but the file length is changed after the FileChannel is obtained.
>
> I realize this is more work than what you might have wanted to put 
> into this but we have to extremely careful here.
>
> -Alan
>
I agree it's a good idea to extend coverage in this area.
I'll check existing tests and will add whatever is not yet there.

With kind regards,
Ivan



More information about the core-libs-dev mailing list