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

Bugs in CopyUtilsTest test cases?

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0
    • Component/s: None
    • Labels:
      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

            • Assignee:
              niallp Niall Pemberton
              Reporter:
              sebb@apache.org Sebb
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: