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

java.io.CharArrayReader count field spec misleading

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.3.0
    • docs
    • beta
    • x86
    • linux



      Name: rl66838 Date: 07/14/2000


      The J2SE 1.3 API spec says that count is the number of valid characters in the
      buffer. That's misleading since it's actually used for the "end of buffer" index.
      You can see that by defining a class CARI that extends CharArrayReader,
      and then creating a new CARI like this:

      CARI c = new CARI(new char[5], 4, 0);

      c.count is 4 and not zero, as "number of valid characters" implies. Clarify what
      valid means in the context.

      http://java.sun.com/j2se/1.3/docs/api/java/io/CharArrayReader.html#count
      (Review ID: 107175)
      ======================================================================

            jhosunw Jamie Ho (Inactive)
            rlewis Roger Lewis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: