public static void set(Object array, int index, Object value) { if (array instanceof Object[]) {  if (!array.getClass().getComponentType().isInstance(value))
public static void set(Object array, int index, Object value) { if (array instanceof Object[]) {  if (value != null && ! array.getClass().getComponentType().isInstance(value))
	public static void set(Object array, int index, Object value) {		if (array instanceof Object[]) {			// Too bad Sun won't let us throw the easier ArrayStoreException!			if (!array.getClass().getComponentType().isInstance(value))				throw new IllegalArgumentException();			((Object[]) array)[index] = value;		} else if (value instanceof Boolean)			setBoolean(array, index, ((Boolean) value).booleanValue());		else if (value instanceof Byte)			setByte(array, index, ((Byte) value).byteValue());		else if (value instanceof Character)			setChar(array, index, ((Character) value).charValue());		else if (value instanceof Short)			setShort(array, index, ((Short) value).shortValue());		else if (value instanceof Integer)			setInt(array, index, ((Integer) value).intValue());		else if (value instanceof Long)			setLong(array, index, ((Long) value).longValue());		else if (value instanceof Float)			setFloat(array, index, ((Float) value).floatValue());		else if (value instanceof Double)			setDouble(array, index, ((Double) value).doubleValue());		else if (array == null)			throw new NullPointerException();		else			throw new IllegalArgumentException();	}