Commons IO
  1. Commons IO
  2. IO-242

Pre- and post-processing support for ProxyReader/Writer

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0
    • Component/s: Streams/Writers
    • Labels:
      None

      Description

      In IO-211 we added protected before/after methods for all read and write operations in ProxyInputStream and ProxyOutputStream. I now have a use case where I need similar functionality also for a Writer, so I've implemented the same feature also for ProxyReader and ProxyWriter. I'll attach the patch for review before committing it.

      1. IO-242.patch
        9 kB
        Jukka Zitting

        Activity

        Mark Thomas made changes -
        Workflow jira [ 12502361 ] Default workflow, editable Closed status [ 12601907 ]
        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Jukka Zitting added a comment -

        Good point. I added null protection in revision 934035.

        Show
        Jukka Zitting added a comment - Good point. I added null protection in revision 934035.
        Hide
        Niall Pemberton added a comment -

        The only comment I would make is that this proxy can now throw NPE if the String/char[]/CharBuffer is null - whereas in the past it would have just passed a null on to the delegate Reader/Writer.

        I added test cases for nulls:

        http://svn.apache.org/viewvc?view=revision&revision=934024

        IMO at least for the ProxyWriter then it shouldn't now be throwing a NPE

        Show
        Niall Pemberton added a comment - The only comment I would make is that this proxy can now throw NPE if the String/char[]/CharBuffer is null - whereas in the past it would have just passed a null on to the delegate Reader/Writer. I added test cases for nulls: http://svn.apache.org/viewvc?view=revision&revision=934024 IMO at least for the ProxyWriter then it shouldn't now be throwing a NPE
        Jukka Zitting made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Jukka Zitting added a comment -

        Patch committed in revision 933964.

        Show
        Jukka Zitting added a comment - Patch committed in revision 933964.
        Jukka Zitting made changes -
        Field Original Value New Value
        Attachment IO-242.patch [ 12439279 ]
        Hide
        Jukka Zitting added a comment -

        Proposed patch.

        Show
        Jukka Zitting added a comment - Proposed patch.
        Jukka Zitting created issue -

          People

          • Assignee:
            Jukka Zitting
            Reporter:
            Jukka Zitting
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development