JDK-6984545 : (fc) transferFrom does not throw NonReadableChannelException when target is size 0 and non-readable
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2010-09-14
  • Updated: 2011-03-08
  • Resolved: 2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b112Fixed
Related Reports
Relates :  
Relates :  
Description
transferFrom(ReadableByteChannel,long,long) does not throw NonReadableChannelException if the target is a FileChannel that is not readable and the file size is 0. If the file size is > 0 then NonReadableChannelException is thrown as expected.

This is a regression in jdk7-b109 and arises because the updated implementation does not attempt to mmap the target file when it is 0 bytes. It causes the following JCK test to fail:

api/java_nio/channels/FileChannel/index.html#Methods[FileChannel0024]

This bug was originally reported via 6984182 along with other failures but these other failures do not appear to be JDK issues.

Comments
EVALUATION The updated implementation doesn't attempt to mmap the target file when its size is 0 bytes.
14-09-2010