heap o' bugfixes

This commit is contained in:
Joel Dice
2007-08-19 20:57:32 -06:00
parent 7a340fd8fb
commit e2f3e80bdf
11 changed files with 47 additions and 49 deletions

View File

@ -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);

View File

@ -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) {