mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +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);
|
||||
|
@ -73,11 +73,11 @@ public class Method<T> extends AccessibleObject implements Member {
|
||||
types[index++] = Class.forName(name);
|
||||
} else {
|
||||
String name = spec.substring(start, i + 1);
|
||||
types[index++] = Class.forName(name);
|
||||
types[index++] = Class.forCanonicalName(name);
|
||||
}
|
||||
} else {
|
||||
String name = spec.substring(i, i + 1);
|
||||
types[index++] = Class.forName(name);
|
||||
types[index++] = Class.forCanonicalName(name);
|
||||
}
|
||||
}
|
||||
} catch (ClassNotFoundException e) {
|
||||
|
Reference in New Issue
Block a user