Swap two elements of a long array at the specified positions

@param longArray array that will have two of its values swapped.
@param index1 one of the indexes of the array.
@param index2 other index of the array.
352217
public static void swap(long[] longArray, int index1, int index2) {
        TrivialSwap.swap(longArray, index1, longArray, index2);
    }
1260137
public static void swap(int[] intArray, int index1, int index2) {
        XORSwap.swap(intArray, index1, intArray, index2);
    }
75056
private void swap(int i, int j, int[] sbox) {
		int temp = sbox[i];
		sbox[i] = sbox[j];
		sbox[j] = temp;
	}
636641
public static void setLong(MemorySegment[] segments, int offset, long value) {
		if (inFirstSegment(segments, offset, 8)) {
			segments[0].putLong(offset, value);
		} else {
			setLongMultiSegments(segments, offset, value);
		}
	}
872903
public long[] toPrimitiveArray(long[] array) {
	for (int i = 0, j = 0; i < array.length; ++i) {
	    int index = -1;
	    if (j < indices.length && (index = indices[j]) == i) {
		array[i] = values[j];
		j++;
	    }
	    else
		array[i] = 0;
	}

	return array;
    }
578951
function swapArrayElements(items, indexFrom, indexTo) {
  var item = items[indexTo];
  items[indexTo] = items[indexFrom];
  items[indexFrom] = item;
  return items;
}
1002839
public static void shuffle(int[] intArray) {
		int swapPlace = -1;

		for(int i = 0; i < intArray.length; i++) {
			swapPlace = (int) (Math.random() * (intArray.length - 1 ));
			XORSwap.swap(intArray, i, swapPlace);
		}
	}
577506
public static void longToIntArray(long lValue, int[] buffer, int nStartIndex) {
	buffer[nStartIndex] = (int) (lValue >>> 32);
	buffer[nStartIndex + 1] = (int) lValue;
    }
357953
public void set(LongDoubleSortedVector other) {
        this.used = other.used;
        this.indices = LongArrays.copyOf(other.indices);
        this.values = DoubleArrays.copyOf(other.values);
    }
384551
public static void swap(final int[] arr, final int a, final int b, final int n) {
        for (int i = 0; i < n; ++i)
            swap(arr, a + i, b + i);
    }
136209
public static void swap(char[] charArray, int index1, int index2) {
        XORSwap.swap(charArray, index1, charArray, index2);
    }
383644
public static function exchange(array &$elements, $indexA, $indexB)
    {
        $count = count($elements);

        if (($indexA < 0 || $indexA > ($count - 1))
            || $indexB < 0
            || $indexB > ($count - 1)
        ) {
            throw new IndexOutOfBoundsException();
        }

        $temp = $elements[$indexA];

        $elements[$indexA] = $elements[$indexB];

        $elements[$indexB] = $temp;
    }
1257917
public static void add(double[] array1, double[] array2) {
        assert (array1.length == array2.length);
        for (int i=0; i<array1.length; i++) {
            array1[i] += array2[i];
        }
    }
1184569
private void indexArrayStore(int e, int i)
    {
        if (valueIndexStore.length < e)
        {
            int oldLength = valueIndexStore.length;
            valueIndexStore = Arrays.copyOf(valueIndexStore, e + 2);
            Arrays.fill(valueIndexStore, oldLength, valueIndexStore.length, -1);
        }
        valueIndexStore[e] = i;
    }
234037
public void set(long index, T value)
    {
        array[segment(index)][offset(index)] = value;
    }
76315
function _swapWorkingSetListIndexes(paneId, index1, index2) {
        var pane = _getPane(paneId);

        pane.swapViewListIndexes(index1, index2);
        exports.trigger("workingSetSort", pane.id);
        exports.trigger("_workingSetDisableAutoSort", pane.id);
    }
1272108
public static Object swap(Object array, int index1, int index2) {
		if (isEmpty(array)) {
			throw new IllegalArgumentException("Array must not empty !");
		}
		Object tmp = get(array, index1);
		Array.set(array, index1, Array.get(array, index2));
		Array.set(array, index2, tmp);
		return array;
	}