Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-546

ClosedOutputStream#flush should throw

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.6
    • Component/s: Streams/Writers
    • Labels:
      None

      Description

      While debugging an issue involving usage of CloseShieldOutputStream I discovered that ClosedOutputStream#flush is not overridden and will silently succeed. Not sure how much of a breaking change this might be but I think it makes more sense for ClosedOutputStream#flush to throw. This is only really meaningful in contexts where multiple streams are being chained together and some of the streams before CloseShieldOutputStream perform buffering, but it would make behavior more consistent for these more complex use-cases.

        Attachments

        1. IO-546.patch
          2 kB
          Tomas Celaya

          Issue Links

            Activity

              People

              • Assignee:
                pascalschumacher Pascal Schumacher
                Reporter:
                tjcelaya Tomas Celaya
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: