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

Unclear definition of java.io.InputStream.markSupported()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.2.0
    • docs
    • beta
    • generic, x86
    • generic, windows_nt



      Name: dg70945 Date: 09/25/98


      The specification of this method should probably clarify that, for a given input stream i, implementations are required to return the same value each time markSupported() is called. In other words, whether or not markSupported() is an invariant property of a particular input stream instance.

      I guess this is implicit in the text, but as this is an extremely important invariant for anyone intending to use mark() and reset(), I think it should be made explicit.

      Another point I should make is that the text "Returns: true if this type supports the mark and reset method; false otherwise" implies that the markSupported() property is invariant over _classes_ rather than just _instances_. I.e., that:

          i1.getClass() == i2.getClass() => i1.markSupported() == i2.markSupported()

      where as the earlier text implies:

          i1 == i2 => i1.markSupported() == i2.markSupported()

      I suspect the latter of these two constraints is the intended interpretation (as well as the more flexible). Anyway, whichever invariant is intended should be made clear in the docs.

      regards,

      Roly Perera
      Interactive Computers Ltd
      The Java Spec Report
      (Review ID: 39291)
      ======================================================================

            mmcclosksunw Michael Mccloskey (Inactive)
            dgreensunw Dale Green (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: