[
https://issues.apache.org/jira/browse/LANG-872?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13584692#comment-13584692
]
Duncan Jones commented on LANG-872:
-----------------------------------
Having said that... {{java.util.Arrays.deepEquals()}} and
{{java.util.Arrays.equals()}} would also state that the arrays are equal. Not
what I would expect, but that would suggest the commons-lang implementation is
not unusual.
> EqualsBuilder methods append(Object[],Object[]) and append(Object,Object)
> treats array class dirrerently
> --------------------------------------------------------------------------------------------------------
>
> Key: LANG-872
> URL: https://issues.apache.org/jira/browse/LANG-872
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.builder.*
> Affects Versions: 2.6, 3.1
> Reporter: Algirdas Raščius
> Priority: Minor
> Attachments: commons-lang3-LANG-872.patch
>
>
> Method {{EqualsBuilder.append(Object[],Object[])}} ignores classes of passed
> arrays and returns true if contents of both arrays are equal.
> Method {{EqualsBuilder.append(Object,Object)}} returns false immediately if
> types of passed array arguments are different.
> For example:
> {code}
> public void testEqualsArrays() {
> Object[] aArray = new Object[] {"Value"};
> Object[] bArray = new String[] {"Value"};
> boolean compareAsArrays = new EqualsBuilder().append(aArray,
> bArray).isEquals();
> // compareAsArrays is true
> Object aObj = aArray;
> Object bObj = bArray;
> boolean compareAsObjects = new EqualsBuilder().append(aObj,
> bObj).isEquals();
> // compareAsObjects is false
> assertTrue(compareAsArrays == compareAsObjects); //Fails
> }
> {code}
> Results of both methods should be consistent.
--
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