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

IOUtils.contentEquals* methods returns false if input1 == input2, should return true

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.5
    • Component/s: Utilities
    • Labels:
      None

      Description

      The fix should be relatively simple, just add an identity check to the beginning of the method:

      if(is1 == is2) {
      return true;
      }

      The methods affected are:

      • org.apache.commons.io.IOUtils.contentEquals(InputStream, InputStream)
      • org.apache.commons.io.IOUtils.contentEquals(Reader, Reader)
      • org.apache.commons.io.IOUtils.contentEqualsIgnoreEOL(Reader, Reader)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mmadson Matthew Madson
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: