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:
Matthew Jason Benson 2009-09-11 18:56:24 +00:00
parent 3d69a1f2cd
commit 014c032b16
1 changed files with 2 additions and 2 deletions

View File

@ -1239,7 +1239,7 @@ public class ArrayUtils {
return i;
}
}
} else {//TODO add quick type compatibility check
} else if (array.getClass().getComponentType().isInstance(objectToFind)) {
for (int i = startIndex; i < array.length; i++) {
if (objectToFind.equals(array[i])) {
return i;
@ -1292,7 +1292,7 @@ public class ArrayUtils {
return i;
}
}
} else {//TODO as above
} else if (array.getClass().getComponentType().isInstance(objectToFind)) {
for (int i = startIndex; i >= 0; i--) {
if (objectToFind.equals(array[i])) {
return i;