Make an array type from the delegate's type, if it's not already an array.
The idea with array expansion is to allow access to properties of X from an
array of X. We call the accessor For each X in the array we call the
543512
public IType getFeatureType()
  {
    if( _delegate.getFeatureType().isArray() )
    {
      return _delegate.getFeatureType();
    }
    return _delegate.getFeatureType().getArrayType();
  }
384211
public final static Object toObjectArray(final Object array) {
        if (!array.getClass().isArray()) {
            return array;
        }
        final Class<?> clazz = PRIMITIVE_TO_OBJ.get(array.getClass().getComponentType());
        return setArray(clazz, array);
    }
1278073
def array(description, **kwargs) -> typing.Type:
    
    kwargs['description'] = description
    return type('Array', (Array,), kwargs)
1016426
function buildFromArray({ declaration, name, mapActionType }) {
  if (Array.isArray(declaration)) {
    return (...args) => declaration.reduce(
      (result, key, index) => Object.assign(
        result,
        { [key]: args[index] }
      ),
      { type: mapActionType(name) }
    );
  }
  return null;
}
1273476
public function __fromArray(array $data): void
    {
        $hasArrayAccess = $this instanceof \ArrayAccess;
        foreach ($data as $name => $value) {
            $currentValue = null;
            $currentValueIsSet = false;
            $isReadOnly = false;
            if (isset($this->internalDataObjectData['p' . $name])) {
                $propertyData = $this->internalDataObjectData['p' . $name];
                $valueIsSet = false;
                if (isset($propertyData[6])) { // type
                    $type = $propertyData[6];
                    $isNullable = $type[0] === '?';
                    if ($isNullable) {
                        $type = substr($type, 1);
                    }
                } else {
                    $type = null;
                    $isNullable = true;
                }
                if (isset($propertyData[5])) { // readonly
                    $currentValue = $this->$name;
                    $currentValueIsSet = true;
                    $isReadOnly = true;
                } elseif (isset($propertyData[1])) { // init
                    $currentValue = $this->$name;
                    $currentValueIsSet = true;
                } elseif ($type !== null && $type !== 'array' && $type !== 'float' && $type !== 'int' && $type !== 'string') {
                    if ($value !== null) {
                        if (class_exists($type)) {
                            if (is_callable([$type, 'fromArray'])) {
                                if (is_array($value)) {
                                    $value = call_user_func([$type, 'fromArray'], $value);
                                    $valueIsSet = true;
                                } else {
                                    throw new \Exception('Cannot assing value of type ' . gettype($value) . ' to an object!');
                                }
                            } else {
                                $currentValue = new $type();
                                $currentValueIsSet = true;
                            }
                        } else {
                            throw new \Exception('Cannot find class named ' . $type . ' for property ' . $name . '!');
                        }
                    } else {
                        if ($isNullable) {
                            $value = null;
                            $valueIsSet = true;
                        } else {
                            throw new \Exception('The property ' . $name . ' value cannot be null!');
                        }
                    }
                }
                if (!$currentValueIsSet && isset($propertyData[0])) { // default init
                    $currentValue = $this->$name;
                }
                if (!$valueIsSet && is_object($currentValue)) {
                    if (method_exists($currentValue, '__fromArray')) {
                        $currentValue->__fromArray($value);
                    } elseif ($type === 'DateTime') {
                        $currentValue->setTimestamp(strtotime($value));
                    } else {
                        if (is_array($value)) {
                            $_hasArrayAccess = $currentValue instanceof \ArrayAccess;
                            foreach ($value as $_name => $_value) {
                                if ($_hasArrayAccess) {
                                    $currentValue[$_name] = $_value;
                                } else {
                                    $currentValue->$_name = $_value;
                                }
                            }
                        } else {
                            throw new \Exception('Cannot assing value of type ' . gettype($value) . ' to an object!');
                        }
                    }
                    $value = $currentValue;
                }
            }
            if (!$isReadOnly) {
                if ($hasArrayAccess) {
                    $this[$name] = $value;
                } else {
                    $this->$name = $value;
                }
            }
        }
    }
1291850
protected Object[] _transform(final Object[] array) {
        Object[] result = new Object[array.length];
        for (Object object : array) {
            ArrayUtils.add(result, transform(object));
        }
        return result;
    }
1150105
function createArrayIterator(array, kind) {
  var object = toObject(array);
  var iterator = new ArrayIterator;
  iterator.iteratorObject_ = object;
  iterator.arrayIteratorNextIndex_ = 0;
  iterator.arrayIterationKind_ = kind;
  return iterator;
}
1223554
function makeGetter (arrayType) {
      return function GetViewValue (byteOffset, littleEndian) {
        byteOffset = ToUint32(byteOffset);

        if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) { throw RangeError('Array index out of range'); }

        byteOffset += this.byteOffset;

        var uint8Array = new Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT),
            bytes = [];
        for (var i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) { bytes.push(r(uint8Array, i)); }

        if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) { bytes.reverse(); }

        return r(new arrayType(new Uint8Array(bytes).buffer), 0);
      };
    }
860193
protected void extendArray(int k) {
    // size + 1 could overflow
    if (this.size + k > this.keys.length) {
      int newCapacity;
      if (this.keys.length < 1024) {
        newCapacity = 2 * (this.size + k);
      } else {
        newCapacity = 5 * (this.size + k) / 4;
      }
      this.keys = Arrays.copyOf(this.keys, newCapacity);
      this.values = Arrays.copyOf(this.values, newCapacity);
    }
  }
1315777
function extend(inarr, newlen) {
  //--byte newarr[];
  var newarr;
  if (inarr.length==newlen)
   return inarr;
  newarr=createArrayWithZeros(newlen);
  //--java.lang.System.arraycopy((java.lang.Object)inarr,0,(java.lang.Object)newarr,0,inarr.length);
  this.arraycopy(inarr,0,newarr,0,inarr.length);
  // 0 padding is carried out by the JVM on allocation initialization
  return newarr;
  }
344200
@SuppressWarnings("unchecked")
  public static <T> T[] toArray(Iterable<? extends T> iterable, Class<T> type) {
    Collection<T> collection;
    if (iterable instanceof Collection) {
      collection = (Collection<T>) iterable;
    } else {
      collection = new ArrayList<T>();
      for (T element : iterable) {
        collection.add(element);
      }
    }
    T[] array = (T[]) Array.newInstance(type, collection.size());
    return collection.toArray(array);
  }
858549
private boolean canAutoExpand( JSONArray array ) {
      for( int i = 0; i < array.size(); i++ ){
         if( !(array.get( i ) instanceof JSONObject) ){
            return false;
         }
      }
      return true;
   }
1223203
function isArray(value) {
  return toFunctionCall(
    t.memberExpression(
      t.identifier("Array"),
      t.identifier("isArray")
    ),
    [value]
  );
}
523422
function ( array, from, to ) {

		if ( AnimationUtils.isTypedArray( array ) ) {

			// in ios9 array.subarray(from, undefined) will return empty array
			// but array.subarray(from) or array.subarray(from, len) is correct
			return new array.constructor( array.subarray( from, to !== undefined ? to : array.length ) );

		}

		return array.slice( from, to );

	}
600659
static <T> ArraySet<T> fromArray(List<T> aArray, Boolean aAllowDuplicates) {
        ArraySet<T> set = new ArraySet<>();
        for (int i = 0, len = aArray.size(); i < len; i++) {
            set.add(aArray.get(i), aAllowDuplicates);
        }
        return set;
    }
294620
public static boolean isArray(Type t)
  {
    if(t instanceof Class<?>) {
      return ((Class<?>)t).isArray();
    }
    if(t instanceof GenericArrayType) {
      return true;
    }
    return false;
  }
5412
@SuppressWarnings(
   {
      "unchecked"
   }) public static final <E extends Enum<E>> E[] createTypeArray(Class<E> c, int arraySizeOffset)
   {
      EnumSet<E> set = EnumSet.allOf(c);
      E[] array = (E[]) Array.newInstance(c, set.size() + arraySizeOffset);

      for (E e : set)
      {
         int index = ((MpxjEnum) e).getValue();
         if (index >= 0)
         {
            array[index] = e;
         }
      }
      return array;
   }