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

Bugs in CopyUtilsTest test cases?

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0
    • None
    • None

    Description

      testCopy_byteArrayToWriter() has the following code:

      ByteArrayOutputStream baout = new ByteArrayOutputStream();
      OutputStream out = new YellOnFlushAndCloseOutputStream(baout, false, true); // out is not used
      Writer writer = new java.io.OutputStreamWriter(baout, "US-ASCII"); // uses baout - should it use out instead
      

      It looks like the Writer should be created from out rather than baout - otherwise why create out?

      Similarly for

      testCopy_inputStreamToWriter()
      testCopy_readerToWriter()
      testCopy_stringToWriter()

      The tests still pass if the Writer is changed to use out.

      Thoughts?

      Attachments

        Activity

          People

            niallp Niall Pemberton
            sebb Sebb
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: