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

PrintWriter handling of InterruptedIOException should be removed

XMLWordPrintable

    • b14
    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      PrintStream's handling of InterruptedIOExceptions is documented for `java.io.PrintStream.checkError()`; PrintWriter behaves exactly the same, but the behavior is **not** documented.

      This has also been mentioned in https://bugs.openjdk.java.net/browse/JDK-4329256?focusedCommentId=12138648&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12138648.
      That comment also notes that PrintStream and PrintWriter.flush() and close() do not handle InterruptedIOExceptions, so either that should be fixed (preferred?) or the documentation for `checkError()` of PrintStream and PrintWriter should be adjusted to mention that. Currently it says "If an operation on the underlying output stream throws an InterruptedIOException", and a user would expect that "an operation" also covers `flush()` and `close()`.


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

              Created:
              Updated:
              Resolved: