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

(doc) errors in java.io.PushbackInputStream API documentation

    XMLWordPrintable

Details

    • b51
    • x86
    • windows_2003

    Backports

      Description

        A DESCRIPTION OF THE PROBLEM :
        It looks like java.io.PushbackInputStream was designed in JDK 1.0 to only pushback a single byte, was expanded in JDK 1.1 to allow any number of bytes, but the documentation wasn't fully updated.

        (1) The first sentence of the class doc says:

        >A PushbackInputStream adds functionality to another input stream, namely the ability to "push back" or "unread" one byte.

        However, a PushbackInputStream now has a user-specified buffer capacity. It is not limited it one byte. Fixed version:

        >A PushbackInputStream adds functionality to another input stream, namely the ability to "push back" or "unread" bytes, by storing pushed-back bytes in an internal buffer.

        (2) Both constructors contain the following sentence:

        >Initially, there is no pushed-back byte (the field pushBack is initialized to -1).

        However, there is no such field. Fixed version:

        >Initially, the pushback buffer is empty.

        (3) The one-arg constructor neglects to mention the size of the pushback buffer it creates. It should say:

        >Creates a PushbackInputStream with a 1-byte pushback buffer ...


        URL OF FAULTY DOCUMENTATION :
        https://docs.oracle.com/javase/8/docs/api/java/io/PushbackInputStream.html

        Attachments

          Issue Links

            Activity

              People

                bpb Brian Burkhalter
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: