Name: nt126004 Date: 11/06/2002
FULL PRODUCT VERSION :
Javadoc in 1.4.0 and 1.4.1
A DESCRIPTION OF THE PROBLEM :
Unclear or inconsistent description of behavior in
java.nio.FileChannel.force() javadoc.
From FileChannel.force()
"This method is only guaranteed to force changes that were
made to this channel's file via the methods defined in this
class"
This implies to me that writes on the class that was used
to obtain the FileChannel object (e.g. RandomAccessFile)
are *not* guaranteed to be forced by this call.
But, the class description for FileChannel includes this
"The state of a file channel is intimately connected to
that of the object whose getChannel method returned the
channel. Changing the channel's position, whether
explicitly or by reading or writing bytes, will change the
file position of the originating object, and vice versa.
Changing the file's length via the file channel will change
the length seen via the originating object, and vice versa.
Changing the file's content by writing bytes will change
the content seen by the originating object, and vice
versa. "
If the RandomAccessFile and FileChannel objects
are "intimately connected " then I would expect force() to
force data written by methods of the RandomAccessFile.
Does this inconsistency actually exist?
REPRODUCIBILITY :
This bug can be reproduced always.
(Review ID: 165001)
======================================================================
FULL PRODUCT VERSION :
Javadoc in 1.4.0 and 1.4.1
A DESCRIPTION OF THE PROBLEM :
Unclear or inconsistent description of behavior in
java.nio.FileChannel.force() javadoc.
From FileChannel.force()
"This method is only guaranteed to force changes that were
made to this channel's file via the methods defined in this
class"
This implies to me that writes on the class that was used
to obtain the FileChannel object (e.g. RandomAccessFile)
are *not* guaranteed to be forced by this call.
But, the class description for FileChannel includes this
"The state of a file channel is intimately connected to
that of the object whose getChannel method returned the
channel. Changing the channel's position, whether
explicitly or by reading or writing bytes, will change the
file position of the originating object, and vice versa.
Changing the file's length via the file channel will change
the length seen via the originating object, and vice versa.
Changing the file's content by writing bytes will change
the content seen by the originating object, and vice
versa. "
If the RandomAccessFile and FileChannel objects
are "intimately connected " then I would expect force() to
force data written by methods of the RandomAccessFile.
Does this inconsistency actually exist?
REPRODUCIBILITY :
This bug can be reproduced always.
(Review ID: 165001)
======================================================================
- csr for
-
JDK-8280598 (fc spec) Unclear spec for FileChannel.force
-
- Closed
-
- relates to
-
JDK-8280903 javadoc build fails after JDK-4774868
-
- Closed
-
-
JDK-4780504 (fs) Forcing a read-only file channel should throw more specific exception
-
- Closed
-