public static IRubyObject asetDirect(Ruby runtime, Object array, JavaUtil.JavaConverter javaConverter, int intIndex, IRubyObject value) { try { javaConverter.set(runtime, array, intIndex, value); } catch (IndexOutOfBoundsException e) { throw runtime.newArgumentError( "index out of bounds for java array (" + intIndex + " for length " + Array.getLength(array) + ")"); } catch (ArrayStoreException e) { throw runtime.newTypeError( "wrong element type " + value.getClass() + "(array contains " + array.getClass().getComponentType().getName() + ")"); } catch (IllegalArgumentException iae) { throw runtime.newArgumentError( "wrong element type " + value.getClass() + "(array contains " + array.getClass().getComponentType().getName() + ")"); } return value; }
public static IRubyObject asetDirect(Ruby runtime, Object array, JavaUtil.JavaConverter javaConverter, int intIndex, IRubyObject value) { try { javaConverter.set(runtime, array, intIndex, value); } catch (IndexOutOfBoundsException e) { throw runtime.newArgumentError( "index out of bounds for java array (" + intIndex + " for length " + Array.getLength(array) + ")"); } catch (ArrayStoreException e) { throw runtime.newTypeError( "wrong element type " + value.getClass() + "(array contains " + array.getClass().getComponentType().getName() + ")"); } catch (IllegalArgumentException iae) { throw runtime.newArgumentError( "wrong element type " + value.getClass() + "(array contains " + array.getClass().getComponentType().getName() + ")"); } return value; }
public static IRubyObject asetDirect(Ruby runtime, Object array, JavaUtil.JavaConverter javaConverter, int index, IRubyObject value) { try { javaConverter.set(runtime, array, index, value); } catch (IndexOutOfBoundsException e) { throw mapIndexOutOfBoundsException(runtime, array, index); } catch (ArrayStoreException e) { throw mapArrayStoreException(runtime, array, value.getClass()); } catch (IllegalArgumentException e) { throw mapIllegalArgumentException(runtime, array, value.getClass()); } return value; }
public static IRubyObject asetDirect(Ruby runtime, Object array, JavaUtil.JavaConverter javaConverter, int index, IRubyObject value) { try { javaConverter.set(runtime, array, index, value); } catch (IndexOutOfBoundsException e) { throw mapIndexOutOfBoundsException(runtime, array, index); } catch (ArrayStoreException e) { throw mapArrayStoreException(runtime, array, value.getClass()); } catch (IllegalArgumentException e) { throw mapIllegalArgumentException(runtime, array, value.getClass()); } return value; }