mirror of
https://github.com/corda/corda.git
synced 2025-06-13 12:48:18 +00:00
heap o' bugfixes
This commit is contained in:
@ -28,15 +28,13 @@ public final class Array {
|
||||
return Boolean.valueOf(((boolean[]) array)[index]);
|
||||
case 'L':
|
||||
case '[':
|
||||
return getObject(array, index);
|
||||
return ((Object[]) array)[index];
|
||||
|
||||
default:
|
||||
throw new Error();
|
||||
}
|
||||
}
|
||||
|
||||
private static native Object getObject(Object array, int index);
|
||||
|
||||
public static void set(Object array, int index, Object value) {
|
||||
String className = array.getClass().getName();
|
||||
if (! className.startsWith("[")) {
|
||||
@ -71,7 +69,7 @@ public final class Array {
|
||||
case 'L':
|
||||
case '[':
|
||||
if (array.getClass().getComponentType().isInstance(value)) {
|
||||
setObject(array, index, value);
|
||||
((Object[]) array)[index] = value;
|
||||
} else {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
@ -82,8 +80,6 @@ public final class Array {
|
||||
}
|
||||
}
|
||||
|
||||
private static native void setObject(Object array, int index, Object value);
|
||||
|
||||
public static native int getLength(Object array);
|
||||
|
||||
private static native Object makeObjectArray(Class elementType, int length);
|
||||
|
Reference in New Issue
Block a user