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

Reader:nullReader() spec does not match the behavior

XMLWordPrintable

    • b20
    • Verified

        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.

              reinhapa Patrick Reinhart
              kganapureddy Krushnareddy Ganapureddy
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: