code: public JSONArray put(int index, Object value) throws JSONException {
  		if (value instanceof Number) {
  			// deviate from the original by checking all Numbers, not just floats &
  			// doubles
  			JSON.checkDouble(((Number) value).doubleValue());
  		}
  		while (this.values.size() <= index) {
  			this.values.add(null);
  		}
  		this.values.set(index, value);
  		return this;
  	}
docs: Sets the value at {@code index} to {@code value}, null padding this array to the
  required length if necessary. If a value already exists at {@code
  index}, it will be replaced.
  @param index the index to set the value to
  @param value a {@link JSONObject}, {@link JSONArray}, String, Boolean, Integer,
  Long, Double, {@link JSONObject#NULL}, or {@code null}. May not be
  {@link Double#isNaN() NaNs} or {@link Double#isInfinite() infinities}.
  @return this array.
  @throws JSONException if processing of json failed