diff -r 7ca6bd52b668 -r d962d1330e54 emul/src/main/java/java/lang/reflect/Array.java --- a/emul/src/main/java/java/lang/reflect/Array.java Fri Jan 18 21:21:35 2013 +0100 +++ b/emul/src/main/java/java/lang/reflect/Array.java Fri Jan 18 21:51:06 2013 +0100 @@ -186,8 +186,14 @@ * argument is negative, or if it is greater than or equal to the * length of the specified array */ - public static native Object get(Object array, int index) - throws IllegalArgumentException, ArrayIndexOutOfBoundsException; + public static Object get(Object array, int index) + throws IllegalArgumentException, ArrayIndexOutOfBoundsException { + if (array.getClass().getComponentType().isPrimitive()) { + throw new IllegalArgumentException(); + } else { + return ((Object[])array)[index]; + } + } /** * Returns the value of the indexed component in the specified @@ -399,8 +405,15 @@ * argument is negative, or if it is greater than or equal to * the length of the specified array */ - public static native void set(Object array, int index, Object value) - throws IllegalArgumentException, ArrayIndexOutOfBoundsException; + public static void set(Object array, int index, Object value) + throws IllegalArgumentException, ArrayIndexOutOfBoundsException { + if (array.getClass().getComponentType().isPrimitive()) { + throw new IllegalArgumentException(); + } else { + Object[] arr = (Object[])array; + arr[index] = value; + } + } /** * Sets the value of the indexed component of the specified array