diff -r dfebf4fbb711 -r 05a87bc23192 emul/src/main/java/java/lang/reflect/Array.java --- a/emul/src/main/java/java/lang/reflect/Array.java Fri Jan 18 18:35:17 2013 +0100 +++ b/emul/src/main/java/java/lang/reflect/Array.java Fri Jan 18 19:22:49 2013 +0100 @@ -159,8 +159,16 @@ * @exception IllegalArgumentException if the object argument is not * an array */ - public static native int getLength(Object array) - throws IllegalArgumentException; + public static int getLength(Object array) + throws IllegalArgumentException { + if (!array.getClass().isArray()) { + throw new IllegalArgumentException(); + } + return length(array); + } + + @JavaScriptBody(args = { "arr" }, body = "return arr.length;") + private static native int length(Object arr); /** * Returns the value of the indexed component in the specified