Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4774868

(fc spec) Unclear spec for FileChannel.force

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 19
    • 1.4.0
    • core-libs
    • b08
    • x86
    • windows_nt

      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)
      ======================================================================

            bpb Brian Burkhalter
            nthompsosunw Nathanael Thompson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: