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

Reader:nullReader() spec does not match the behavior

    Details

    • Type: Bug
    • Status: In Progress
    • Priority: P2
    • Resolution: Unresolved
    • Affects Version/s: 11
    • Fix Version/s: 11
    • Component/s: core-libs
    • Subcomponent:
    • Understanding:
      Fix Understood

      Description

      As part of new test development for the CSR : JDK-8196350
      It's been observed that specification mismatch to the behavior.

       java.io.Reader
      Specification :
        nullReader()

       "While the stream is open, the read(), read(char[]), read(char[], int, int), read(Charbuffer), ready()), skip(long), and transferTo() methods all behave as if end of stream has been reached. After the stream has been closed, these methods all throw IOException."
       
       Actual result :
       invoking ready() after closing the nullReader does not throw IOException.
       
      2. "The mark() method does nothing, and the reset() method throws IOException."

        Actual Result :
       Invoking the mark() throws IOException.

      Code snipped attached to demonstrate this.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                reinhapa Patrick Reinhart
                Reporter:
                kganapureddy Krushnareddy Ganapureddy
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: