On Fri, 24 Mar 2023 12:25:55 GMT, Lance Andersen <lan...@openjdk.org> wrote:

>> Sparse files need to be created as such. The purpose of this delete exists 
>> to make this explicit. I moved this closer to the FileChannel.open and added 
>> a comment to explain the delete.
>
> I am fine leaving it, but still not convinced it is needed if the setup 
> method calls the cleanup method and should achieve the same result.  Again no 
> big deal.

Thanks, I agree it is not technically required in this exact context.

The reason I want to keep it is that someone might do a search  for 
`StandardOpenOption.SPARSE`, find this code and copy it. I think the delete 
with the comment makes it explicit that preexisting files will not magically be 
made sparse after the fact. It makes the code samle self-contained.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/12231#discussion_r1147522464

Reply via email to