add quick type compatibility check
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@813984 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3d69a1f2cd
commit
014c032b16
|
@ -1239,7 +1239,7 @@ public class ArrayUtils {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {//TODO add quick type compatibility check
|
} else if (array.getClass().getComponentType().isInstance(objectToFind)) {
|
||||||
for (int i = startIndex; i < array.length; i++) {
|
for (int i = startIndex; i < array.length; i++) {
|
||||||
if (objectToFind.equals(array[i])) {
|
if (objectToFind.equals(array[i])) {
|
||||||
return i;
|
return i;
|
||||||
|
@ -1292,7 +1292,7 @@ public class ArrayUtils {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {//TODO as above
|
} else if (array.getClass().getComponentType().isInstance(objectToFind)) {
|
||||||
for (int i = startIndex; i >= 0; i--) {
|
for (int i = startIndex; i >= 0; i--) {
|
||||||
if (objectToFind.equals(array[i])) {
|
if (objectToFind.equals(array[i])) {
|
||||||
return i;
|
return i;
|
||||||
|
|
Loading…
Reference in New Issue