Two small fixes
Chris Hegarty
chris.hegarty at oracle.com
Mon Aug 23 06:17:21 PDT 2010
On 21/08/2010 16:17, Alan Bateman wrote:
> I'd like to get fixes for two small fixes into b108.
>
> The first is 6431344 where FileChannel's transferTo falls back to mmap
> when sendfile/equivalent can't be used and the target is a "trusted
> channel". The implementation attempts to mmap the entire region to be
> transferred which is problematic for large transfers, esp. 32-bit where
> the address space may not be available. Same issue with transferFrom
> where mmap is used when the source is also a FileChannel. The proposed
> change just maps the file in chunks, up to 8MB at a time. I don't
> propose to include a regression test as the code is well exercised by
> existing tests, and also tests that transfer several GBs take too long
> for the regression test suite. The webrev is here:
> http://cr.openjdk.java.net/~alanb/6431344/webrev
This change mainly looks fine. One minor comment; do we really need the
nested try statements in transferFromFileChannel? Can the catch not
simply match the first try and remove the second?
> The other one is 6978511, an oversight in the implementation to
> Path.toRealPath. The method should fail if the file does not exist. The
> fix is to trivially check that it does actually exist. The webrev is here:
> http://cr.openjdk.java.net/~alanb/6978511/webrev/
This change looks fine.
-Chris.
> Thanks,
> Alan.
More information about the nio-dev
mailing list