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

(spec) InputStream.markSupported: Invariant over all instances?

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.0
    • core-libs
    • None
    • generic
    • generic

      From: "Roly Perera" <###@###.###>
      Subject: java.io.InputStream.markSupported()
      Date: Wed, 23 Sep 1998 12:13:22 +0100

      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.

            iris Iris Clark
            mr Mark Reinhold
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: