You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2013/01/04 16:58:12 UTC

[jira] [Resolved] (IO-362) IOUtils.contentEquals* methods returns false if input1 == input2, should return true

     [ https://issues.apache.org/jira/browse/IO-362?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Gregory resolved IO-362.
-----------------------------

       Resolution: Fixed
    Fix Version/s: 2.5

Fix implemented for the method in the original report and two other IOUtil methods.

{noformat}
commit -m "[IO-362] IOUtils.contentEquals* methods returns false if input1 == input2, should return true." C:/svn/org/apache/commons/trunks-proper/io/src/test/java/org/apache/commons/io/IOUtilsTestCase.java C:/svn/org/apache/commons/trunks-proper/io/src/changes/changes.xml C:/svn/org/apache/commons/trunks-proper/io/src/main/java/org/apache/commons/io/IOUtils.java
    Sending        C:/svn/org/apache/commons/trunks-proper/io/src/changes/changes.xml
    Sending        C:/svn/org/apache/commons/trunks-proper/io/src/main/java/org/apache/commons/io/IOUtils.java
    Sending        C:/svn/org/apache/commons/trunks-proper/io/src/test/java/org/apache/commons/io/IOUtilsTestCase.java
    Transmitting file data ...
    Committed revision 1428941.
{noformat}

                
> IOUtils.contentEquals* methods returns false if input1 == input2, should return true
> ------------------------------------------------------------------------------------
>
>                 Key: IO-362
>                 URL: https://issues.apache.org/jira/browse/IO-362
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.4
>            Reporter: Matthew Madson
>             Fix For: 2.5
>
>
> 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)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira