commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nia...@apache.org
Subject svn commit: r1056983 - /commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/ArrayUtils.java
Date Sun, 09 Jan 2011 17:31:50 GMT
Author: niallp
Date: Sun Jan  9 17:31:50 2011
New Revision: 1056983

URL: http://svn.apache.org/viewvc?rev=1056983&view=rev
Log:
port r813984 to LANG 2.x branch - add quick type compatibility check

Modified:
    commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/ArrayUtils.java

Modified: commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/ArrayUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/ArrayUtils.java?rev=1056983&r1=1056982&r2=1056983&view=diff
==============================================================================
--- commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/ArrayUtils.java
(original)
+++ commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/ArrayUtils.java
Sun Jan  9 17:31:50 2011
@@ -1599,7 +1599,7 @@ public class ArrayUtils {
                     return i;
                 }
             }
-        } else {
+        } else if (array.getClass().getComponentType().isInstance(objectToFind)) {
             for (int i = startIndex; i < array.length; i++) {
                 if (objectToFind.equals(array[i])) {
                     return i;
@@ -1652,7 +1652,7 @@ public class ArrayUtils {
                     return i;
                 }
             }
-        } else {
+        } else if (array.getClass().getComponentType().isInstance(objectToFind)) {
             for (int i = startIndex; i >= 0; i--) {
                 if (objectToFind.equals(array[i])) {
                     return i;



Mime
View raw message