Add LANG-1261 to changes.xml
This commit is contained in:
commit
42f2058c83
|
@ -46,6 +46,7 @@ The <action> type attribute can be add,update,fix,remove.
|
|||
<body>
|
||||
|
||||
<release version="3.5" date="tba" description="New features including Java 9 detection">
|
||||
<action issue="LANG-1261" type="fix" dev="pschumacher" >ArrayUtils.contains returns false for instances of subtypes</action>
|
||||
<action issue="LANG-1197" type="update" dev="pschumacher" >Prepare Java 9 detection</action>
|
||||
<action issue="LANG-1252" type="fix" dev="chtompki" due-to="Rob Tompkins">Rename NumberUtils.isNumber, isCreatable to better reflect createNumber. Also, accommodated for "+" symbol as prefix in isCreatable and isNumber.</action>
|
||||
<action issue="LANG-1262" type="update" dev="pschumacher" due-to="Ruslan Cheremin">CompareToBuilder.append(Object, Object, Comparator) method is too big to be inlined</action>
|
||||
|
|
|
@ -3242,7 +3242,7 @@ public class ArrayUtils {
|
|||
return i;
|
||||
}
|
||||
}
|
||||
} else if (array.getClass().getComponentType().isInstance(objectToFind)) {
|
||||
} else {
|
||||
for (int i = startIndex; i < array.length; i++) {
|
||||
if (objectToFind.equals(array[i])) {
|
||||
return i;
|
||||
|
|
|
@ -2953,7 +2953,23 @@ public class ArrayUtilsTest {
|
|||
assertTrue(ArrayUtils.contains(array, null));
|
||||
assertFalse(ArrayUtils.contains(array, "notInArray"));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testContains_LANG_1261() {
|
||||
class LANG1261ParentObject {
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
class LANG1261ChildObject extends LANG1261ParentObject {
|
||||
}
|
||||
|
||||
Object[] array = new LANG1261ChildObject[] { new LANG1261ChildObject() };
|
||||
|
||||
assertTrue(ArrayUtils.contains(array, new LANG1261ParentObject()));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
@Test
|
||||
public void testIndexOfLong() {
|
||||
|
|
Loading…
Reference in New Issue