diff --git a/java/ql/src/semmle/code/java/frameworks/apache/Lang.qll b/java/ql/src/semmle/code/java/frameworks/apache/Lang.qll index 0b64361c018..7b37cc3b31e 100644 --- a/java/ql/src/semmle/code/java/frameworks/apache/Lang.qll +++ b/java/ql/src/semmle/code/java/frameworks/apache/Lang.qll @@ -49,19 +49,27 @@ private class ApacheLangArrayUtilsTaintPreservingMethod extends TaintPreservingC src = [0 .. getNumberOfParameters() - 1] or this.hasName([ - "clone", "nullToEmpty", "remove", "removeAll", "removeElement", "removeElements", "reverse", - "shift", "shuffle", "subarray", "swap", "toArray", "toMap", "toObject", "toPrimitive", - "toString", "toStringArray" + "clone", "nullToEmpty", "remove", "removeAll", "removeElement", "removeElements", + "subarray", "toArray", "toMap", "toObject", "removeAllOccurences", "removeAllOccurrences" ]) and src = 0 or + this.hasName("toPrimitive") and + src = [0, 1] + or this.hasName("add") and this.getNumberOfParameters() = 2 and src = [0, 1] or - this.hasName("add") and + this.hasName(["add"]) and this.getNumberOfParameters() = 3 and src = [0, 2] + or + this.hasName("insert") and + src = [1, 2] + or + this.hasName("get") and + src = [0, 2] } } diff --git a/java/ql/test/library-tests/frameworks/apache-commons-lang3/ArrayUtilsTest.java b/java/ql/test/library-tests/frameworks/apache-commons-lang3/ArrayUtilsTest.java new file mode 100644 index 00000000000..73773a8d61c --- /dev/null +++ b/java/ql/test/library-tests/frameworks/apache-commons-lang3/ArrayUtilsTest.java @@ -0,0 +1,75 @@ +import org.apache.commons.lang3.ArrayUtils; +import java.io.StringReader; +import java.nio.CharBuffer; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; + +class ArrayUtilsTest { + String taint() { return "tainted"; } + + private static class IntSource { + static int taint() { return 0; } + } + + void sink(Object o) {} + + void test() throws Exception { + + // All methods of this class copy the input array, so the incoming array should not be assigned taint. + String[] alreadyTainted = new String[] { taint() }; + String[] clean = new String[] { "Untainted" }; + + sink(ArrayUtils.add(clean, 0, taint())); // $hasTaintFlow + sink(ArrayUtils.add(alreadyTainted, 0, "clean")); // $hasTaintFlow + sink(ArrayUtils.add(clean, IntSource.taint(), "clean")); // Index argument does not contribute taint + sink(ArrayUtils.add(clean, taint())); // $hasTaintFlow + sink(ArrayUtils.add(alreadyTainted, "clean")); // $hasTaintFlow + sink(ArrayUtils.addAll(clean, "clean", taint())); // $hasTaintFlow + sink(ArrayUtils.addAll(clean, taint(), "clean")); // $hasTaintFlow + sink(ArrayUtils.addAll(alreadyTainted, "clean", "also clean")); // $hasTaintFlow + sink(ArrayUtils.addFirst(clean, taint())); // $hasTaintFlow + sink(ArrayUtils.addFirst(alreadyTainted, "clean")); // $hasTaintFlow + sink(ArrayUtils.clone(alreadyTainted)); // $hasTaintFlow + sink(ArrayUtils.get(alreadyTainted, 0)); // $hasTaintFlow + sink(ArrayUtils.get(clean, IntSource.taint())); // Index argument does not contribute taint + sink(ArrayUtils.get(alreadyTainted, 0, "default value")); // $hasTaintFlow + sink(ArrayUtils.get(clean, IntSource.taint(), "default value")); // Index argument does not contribute taint + sink(ArrayUtils.get(clean, 0, taint())); // $hasTaintFlow + sink(ArrayUtils.insert(IntSource.taint(), clean, "value1", "value2")); // Index argument does not contribute taint + sink(ArrayUtils.insert(0, alreadyTainted, "value1", "value2")); // $hasTaintFlow + sink(ArrayUtils.insert(0, clean, taint(), "value2")); // $hasTaintFlow + sink(ArrayUtils.insert(0, clean, "value1", taint())); // $hasTaintFlow + sink(ArrayUtils.nullToEmpty(alreadyTainted)); // $hasTaintFlow + sink(ArrayUtils.nullToEmpty(alreadyTainted, String[].class)); // $hasTaintFlow + sink(ArrayUtils.remove(alreadyTainted, 0)); // $hasTaintFlow + sink(ArrayUtils.remove(clean, IntSource.taint())); // Index argument does not contribute taint + sink(ArrayUtils.removeAll(alreadyTainted, 0, 1)); // $hasTaintFlow + sink(ArrayUtils.removeAll(clean, IntSource.taint(), 1)); // Index argument does not contribute taint + sink(ArrayUtils.removeAll(clean, 0, IntSource.taint())); // Index argument does not contribute taint + sink(ArrayUtils.removeAllOccurences(clean, taint())); // Removed argument does not contribute taint + sink(ArrayUtils.removeAllOccurences(alreadyTainted, "value to remove")); // $hasTaintFlow + sink(ArrayUtils.removeAllOccurrences(clean, taint())); // Removed argument does not contribute taint + sink(ArrayUtils.removeAllOccurrences(alreadyTainted, "value to remove")); // $hasTaintFlow + sink(ArrayUtils.removeElement(clean, taint())); // Removed argument does not contribute taint + sink(ArrayUtils.removeElement(alreadyTainted, "value to remove")); // $hasTaintFlow + sink(ArrayUtils.removeElements(alreadyTainted, 0, 1)); // $hasTaintFlow + sink(ArrayUtils.removeElements(clean, IntSource.taint(), 1)); // Index argument does not contribute taint + sink(ArrayUtils.removeElements(clean, 0, IntSource.taint())); // Index argument does not contribute taint + sink(ArrayUtils.subarray(alreadyTainted, 0, 0)); // $hasTaintFlow + sink(ArrayUtils.subarray(clean, IntSource.taint(), IntSource.taint())); // Index arguments do not contribute taint + sink(ArrayUtils.toArray("clean", taint())); // $hasTaintFlow + sink(ArrayUtils.toArray(taint(), "clean")); // $hasTaintFlow + sink(ArrayUtils.toMap(alreadyTainted).get("key")); // $hasTaintFlow + + // Check that none of the above had an effect on `clean`: + sink(clean); + + int[] taintedInts = new int[] { IntSource.taint() }; + Integer[] taintedBoxedInts = ArrayUtils.toObject(taintedInts); + sink(taintedBoxedInts); // $hasTaintFlow + sink(ArrayUtils.toPrimitive(taintedBoxedInts)); // $hasTaintFlow + sink(ArrayUtils.toPrimitive(new Integer[] {}, IntSource.taint())); // $hasTaintFlow + + } + } \ No newline at end of file diff --git a/java/ql/test/stubs/apache-commons-lang3-3.7/org/apache/commons/lang3/ArrayUtils.java b/java/ql/test/stubs/apache-commons-lang3-3.7/org/apache/commons/lang3/ArrayUtils.java new file mode 100644 index 00000000000..d57fe87b9a8 --- /dev/null +++ b/java/ql/test/stubs/apache-commons-lang3-3.7/org/apache/commons/lang3/ArrayUtils.java @@ -0,0 +1,1383 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.lang3; + +import java.lang.reflect.Array; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.Type; +import java.util.Arrays; +import java.util.BitSet; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; +import java.util.Random; + + +public class ArrayUtils { + public static boolean[] add(final boolean[] array, final boolean element) { + return null; + } + + public static boolean[] add(final boolean[] array, final int index, final boolean element) { + return null; + } + + public static byte[] add(final byte[] array, final byte element) { + return null; + } + + public static byte[] add(final byte[] array, final int index, final byte element) { + return null; + } + + public static char[] add(final char[] array, final char element) { + return null; + } + + public static char[] add(final char[] array, final int index, final char element) { + return null; + } + + public static double[] add(final double[] array, final double element) { + return null; + } + + public static double[] add(final double[] array, final int index, final double element) { + return null; + } + + public static float[] add(final float[] array, final float element) { + return null; + } + + public static float[] add(final float[] array, final int index, final float element) { + return null; + } + + public static int[] add(final int[] array, final int element) { + return null; + } + + public static int[] add(final int[] array, final int index, final int element) { + return null; + } + + public static long[] add(final long[] array, final int index, final long element) { + return null; + } + + public static long[] add(final long[] array, final long element) { + return null; + } + + public static short[] add(final short[] array, final int index, final short element) { + return null; + } + + public static short[] add(final short[] array, final short element) { + return null; + } + + public static T[] add(final T[] array, final int index, final T element) { + return null; + } + + public static T[] add(final T[] array, final T element) { + return null; + } + + public static boolean[] addAll(final boolean[] array1, final boolean... array2) { + return null; + } + + public static byte[] addAll(final byte[] array1, final byte... array2) { + return null; + } + + public static char[] addAll(final char[] array1, final char... array2) { + return null; + } + + public static double[] addAll(final double[] array1, final double... array2) { + return null; + } + + public static float[] addAll(final float[] array1, final float... array2) { + return null; + } + + public static int[] addAll(final int[] array1, final int... array2) { + return null; + } + + public static long[] addAll(final long[] array1, final long... array2) { + return null; + } + + public static short[] addAll(final short[] array1, final short... array2) { + return null; + } + + public static T[] addAll(final T[] array1, @SuppressWarnings("unchecked") final T... array2) { + return null; + } + + public static boolean[] addFirst(final boolean[] array, final boolean element) { + return null; + } + + public static byte[] addFirst(final byte[] array, final byte element) { + return null; + } + + public static char[] addFirst(final char[] array, final char element) { + return null; + } + + public static double[] addFirst(final double[] array, final double element) { + return null; + } + + public static float[] addFirst(final float[] array, final float element) { + return null; + } + + public static int[] addFirst(final int[] array, final int element) { + return null; + } + + public static long[] addFirst(final long[] array, final long element) { + return null; + } + + public static short[] addFirst(final short[] array, final short element) { + return null; + } + + public static T[] addFirst(final T[] array, final T element) { + return null; + } + + public static boolean[] clone(final boolean[] array) { + return null; + } + + public static byte[] clone(final byte[] array) { + return null; + } + + public static char[] clone(final char[] array) { + return null; + } + + public static double[] clone(final double[] array) { + return null; + } + + public static float[] clone(final float[] array) { + return null; + } + + public static int[] clone(final int[] array) { + return null; + } + + public static long[] clone(final long[] array) { + return null; + } + + public static short[] clone(final short[] array) { + return null; + } + + public static T[] clone(final T[] array) { + return null; + } + + public static boolean contains(final boolean[] array, final boolean valueToFind) { + return false; + } + + public static boolean contains(final byte[] array, final byte valueToFind) { + return false; + } + + public static boolean contains(final char[] array, final char valueToFind) { + return false; + } + + public static boolean contains(final double[] array, final double valueToFind) { + return false; + } + + public static boolean contains(final double[] array, final double valueToFind, final double tolerance) { + return false; + } + + public static boolean contains(final float[] array, final float valueToFind) { + return false; + } + + public static boolean contains(final int[] array, final int valueToFind) { + return false; + } + + public static boolean contains(final long[] array, final long valueToFind) { + return false; + } + + public static boolean contains(final Object[] array, final Object objectToFind) { + return false; + } + + public static boolean contains(final short[] array, final short valueToFind) { + return false; + } + + public static T get(final T[] array, final int index) { + return null; + } + + public static T get(final T[] array, final int index, final T defaultValue) { + return null; + } + + public static int getLength(final Object array) { + return 0; + } + + public static int hashCode(final Object array) { + return 0; + } + + public static BitSet indexesOf(final boolean[] array, final boolean valueToFind) { + return null; + } + + public static BitSet indexesOf(final boolean[] array, final boolean valueToFind, int startIndex) { + return null; + } + + public static BitSet indexesOf(final byte[] array, final byte valueToFind) { + return null; + } + + public static BitSet indexesOf(final byte[] array, final byte valueToFind, int startIndex) { + return null; + } + + public static BitSet indexesOf(final char[] array, final char valueToFind) { + return null; + } + + public static BitSet indexesOf(final char[] array, final char valueToFind, int startIndex) { + return null; + } + + public static BitSet indexesOf(final double[] array, final double valueToFind) { + return null; + } + + public static BitSet indexesOf(final double[] array, final double valueToFind, final double tolerance) { + return null; + } + + public static BitSet indexesOf(final double[] array, final double valueToFind, int startIndex) { + return null; + } + + public static BitSet indexesOf(final double[] array, final double valueToFind, int startIndex, final double tolerance) { + return null; + } + + public static BitSet indexesOf(final float[] array, final float valueToFind) { + return null; + } + + public static BitSet indexesOf(final float[] array, final float valueToFind, int startIndex) { + return null; + } + + public static BitSet indexesOf(final int[] array, final int valueToFind) { + return null; + } + + public static BitSet indexesOf(final int[] array, final int valueToFind, int startIndex) { + return null; + } + + public static BitSet indexesOf(final long[] array, final long valueToFind) { + return null; + } + + public static BitSet indexesOf(final long[] array, final long valueToFind, int startIndex) { + return null; + } + + public static BitSet indexesOf(final Object[] array, final Object objectToFind) { + return null; + } + + public static BitSet indexesOf(final Object[] array, final Object objectToFind, int startIndex) { + return null; + } + + public static BitSet indexesOf(final short[] array, final short valueToFind) { + return null; + } + + public static BitSet indexesOf(final short[] array, final short valueToFind, int startIndex) { + return null; + } + + public static int indexOf(final boolean[] array, final boolean valueToFind) { + return 0; + } + + public static int indexOf(final boolean[] array, final boolean valueToFind, int startIndex) { + return 0; + } + + public static int indexOf(final byte[] array, final byte valueToFind) { + return 0; + } + + public static int indexOf(final byte[] array, final byte valueToFind, int startIndex) { + return 0; + } + + public static int indexOf(final char[] array, final char valueToFind) { + return 0; + } + + public static int indexOf(final char[] array, final char valueToFind, int startIndex) { + return 0; + } + + public static int indexOf(final double[] array, final double valueToFind) { + return 0; + } + + public static int indexOf(final double[] array, final double valueToFind, final double tolerance) { + return 0; + } + + public static int indexOf(final double[] array, final double valueToFind, int startIndex) { + return 0; + } + + public static int indexOf(final double[] array, final double valueToFind, int startIndex, final double tolerance) { + return 0; + } + + public static int indexOf(final float[] array, final float valueToFind) { + return 0; + } + + public static int indexOf(final float[] array, final float valueToFind, int startIndex) { + return 0; + } + + public static int indexOf(final int[] array, final int valueToFind) { + return 0; + } + +public static int indexOf(final int[] array, final int valueToFind, int startIndex) { + return 0; +} + + public static int indexOf(final long[] array, final long valueToFind) { + return 0; + } + + public static int indexOf(final long[] array, final long valueToFind, int startIndex) { + return 0; + } + + public static int indexOf(final Object[] array, final Object objectToFind) { + return 0; + } + + public static int indexOf(final Object[] array, final Object objectToFind, int startIndex) { + return 0; + } + + public static int indexOf(final short[] array, final short valueToFind) { + return 0; + } + + public static int indexOf(final short[] array, final short valueToFind, int startIndex) { + return 0; + } + + public static boolean[] insert(final int index, final boolean[] array, final boolean... values) { + return null; + } + + public static byte[] insert(final int index, final byte[] array, final byte... values) { + return null; + } + + public static char[] insert(final int index, final char[] array, final char... values) { + return null; + } + + public static double[] insert(final int index, final double[] array, final double... values) { + return null; + } + + public static float[] insert(final int index, final float[] array, final float... values) { + return null; + } + + public static int[] insert(final int index, final int[] array, final int... values) { + return null; + } + + public static long[] insert(final int index, final long[] array, final long... values) { + return null; + } + + public static short[] insert(final int index, final short[] array, final short... values) { + return null; + } + + public static T[] insert(final int index, final T[] array, final T... values) { + return null; + } + + public static boolean isArrayIndexValid(final T[] array, final int index) { + return false; + } + + public static boolean isEmpty(final boolean[] array) { + return false; + } + + public static boolean isEmpty(final byte[] array) { + return false; + } + + public static boolean isEmpty(final char[] array) { + return false; + } + + public static boolean isEmpty(final double[] array) { + return false; + } + + public static boolean isEmpty(final float[] array) { + return false; + } + + public static boolean isEmpty(final int[] array) { + return false; + } + + public static boolean isEmpty(final long[] array) { + return false; + } + + public static boolean isEmpty(final Object[] array) { + return false; + } + + public static boolean isEmpty(final short[] array) { + return false; + } + + public static boolean isEquals(final Object array1, final Object array2) { + return false; + } + + public static boolean isNotEmpty(final boolean[] array) { + return false; + } + + public static boolean isNotEmpty(final byte[] array) { + return false; + } + + public static boolean isNotEmpty(final char[] array) { + return false; + } + + public static boolean isNotEmpty(final double[] array) { + return false; + } + + public static boolean isNotEmpty(final float[] array) { + return false; + } + + public static boolean isNotEmpty(final int[] array) { + return false; + } + + public static boolean isNotEmpty(final long[] array) { + return false; + } + + public static boolean isNotEmpty(final short[] array) { + return false; + } + + public static boolean isNotEmpty(final T[] array) { + return false; + } + + public static boolean isSameLength(final boolean[] array1, final boolean[] array2) { + return false; + } + + public static boolean isSameLength(final byte[] array1, final byte[] array2) { + return false; + } + + public static boolean isSameLength(final char[] array1, final char[] array2) { + return false; + } + + public static boolean isSameLength(final double[] array1, final double[] array2) { + return false; + } + + public static boolean isSameLength(final float[] array1, final float[] array2) { + return false; + } + + public static boolean isSameLength(final int[] array1, final int[] array2) { + return false; + } + + public static boolean isSameLength(final long[] array1, final long[] array2) { + return false; + } + + public static boolean isSameLength(final Object array1, final Object array2) { + return false; + } + + public static boolean isSameLength(final Object[] array1, final Object[] array2) { + return false; + } + + public static boolean isSameLength(final short[] array1, final short[] array2) { + return false; + } + + public static boolean isSameType(final Object array1, final Object array2) { + return false; + } + + public static boolean isSorted(final boolean[] array) { + return false; + } + + public static boolean isSorted(final byte[] array) { + return false; + } + + public static boolean isSorted(final char[] array) { + return false; + } + + public static boolean isSorted(final double[] array) { + return false; + } + + public static boolean isSorted(final float[] array) { + return false; + } + + public static boolean isSorted(final int[] array) { + return false; + } + + public static boolean isSorted(final long[] array) { + return false; + } + + public static boolean isSorted(final short[] array) { + return false; + } + + public static > boolean isSorted(final T[] array) { + return false; + } + + public static boolean isSorted(final T[] array, final Comparator comparator) { + return false; + } + + public static int lastIndexOf(final boolean[] array, final boolean valueToFind) { + return 0; + } + + public static int lastIndexOf(final boolean[] array, final boolean valueToFind, int startIndex) { + return 0; + } + + public static int lastIndexOf(final byte[] array, final byte valueToFind) { + return 0; + } + + public static int lastIndexOf(final byte[] array, final byte valueToFind, int startIndex) { + return 0; + } + + public static int lastIndexOf(final char[] array, final char valueToFind) { + return 0; + } + + public static int lastIndexOf(final char[] array, final char valueToFind, int startIndex) { + return 0; + } + + public static int lastIndexOf(final double[] array, final double valueToFind) { + return 0; + } + + public static int lastIndexOf(final double[] array, final double valueToFind, final double tolerance) { + return 0; + } + + public static int lastIndexOf(final double[] array, final double valueToFind, int startIndex) { + return 0; + } + + public static int lastIndexOf(final double[] array, final double valueToFind, int startIndex, final double tolerance) { + return 0; + } + + public static int lastIndexOf(final float[] array, final float valueToFind) { + return 0; + } + + public static int lastIndexOf(final float[] array, final float valueToFind, int startIndex) { + return 0; + } + + public static int lastIndexOf(final int[] array, final int valueToFind) { + return 0; + } + + public static int lastIndexOf(final int[] array, final int valueToFind, int startIndex) { + return 0; + } + + public static int lastIndexOf(final long[] array, final long valueToFind) { + return 0; + } + + public static int lastIndexOf(final long[] array, final long valueToFind, int startIndex) { + return 0; + } + + public static int lastIndexOf(final Object[] array, final Object objectToFind) { + return 0; + } + + public static int lastIndexOf(final Object[] array, final Object objectToFind, int startIndex) { + return 0; + } + + public static int lastIndexOf(final short[] array, final short valueToFind) { + return 0; + } + + public static int lastIndexOf(final short[] array, final short valueToFind, int startIndex) { + return 0; + } + + public static boolean[] nullToEmpty(final boolean[] array) { + return null; + } + + public static Boolean[] nullToEmpty(final Boolean[] array) { + return null; + } + + public static byte[] nullToEmpty(final byte[] array) { + return null; + } + + public static Byte[] nullToEmpty(final Byte[] array) { + return null; + } + + public static char[] nullToEmpty(final char[] array) { + return null; + } + + public static Character[] nullToEmpty(final Character[] array) { + return null; + } + + public static Class[] nullToEmpty(final Class[] array) { + return null; + } + + public static double[] nullToEmpty(final double[] array) { + return null; + } + + public static Double[] nullToEmpty(final Double[] array) { + return null; + } + + public static float[] nullToEmpty(final float[] array) { + return null; + } + + public static Float[] nullToEmpty(final Float[] array) { + return null; + } + + public static int[] nullToEmpty(final int[] array) { + return null; + } + + public static Integer[] nullToEmpty(final Integer[] array) { + return null; + } + + public static long[] nullToEmpty(final long[] array) { + return null; + } + + public static Long[] nullToEmpty(final Long[] array) { + return null; + } + + public static Object[] nullToEmpty(final Object[] array) { + return null; + } + + public static short[] nullToEmpty(final short[] array) { + return null; + } + + public static Short[] nullToEmpty(final Short[] array) { + return null; + } + + public static String[] nullToEmpty(final String[] array) { + return null; + } + + public static T[] nullToEmpty(final T[] array, final Class type) { + return null; + } + + public static boolean[] remove(final boolean[] array, final int index) { + return null; + } + + public static byte[] remove(final byte[] array, final int index) { + return null; + } + + public static char[] remove(final char[] array, final int index) { + return null; + } + + public static double[] remove(final double[] array, final int index) { + return null; + } + + public static float[] remove(final float[] array, final int index) { + return null; + } + + public static int[] remove(final int[] array, final int index) { + return null; + } + + public static long[] remove(final long[] array, final int index) { + return null; + } + + public static short[] remove(final short[] array, final int index) { + return null; + } + + public static T[] remove(final T[] array, final int index) { + return null; + } + + public static boolean[] removeAll(final boolean[] array, final int... indices) { + return null; + } + + public static byte[] removeAll(final byte[] array, final int... indices) { + return null; + } + + public static char[] removeAll(final char[] array, final int... indices) { + return null; + } + + public static double[] removeAll(final double[] array, final int... indices) { + return null; + } + + public static float[] removeAll(final float[] array, final int... indices) { + return null; + } + + public static int[] removeAll(final int[] array, final int... indices) { + return null; + } + + public static long[] removeAll(final long[] array, final int... indices) { + return null; + } + + public static short[] removeAll(final short[] array, final int... indices) { + return null; + } + + public static T[] removeAll(final T[] array, final int... indices) { + return null; + } + + public static boolean[] removeAllOccurences(final boolean[] array, final boolean element) { + return null; + } + + public static byte[] removeAllOccurences(final byte[] array, final byte element) { + return null; + } + + public static char[] removeAllOccurences(final char[] array, final char element) { + return null; + } + + public static double[] removeAllOccurences(final double[] array, final double element) { + return null; + } + + public static float[] removeAllOccurences(final float[] array, final float element) { + return null; + } + + public static int[] removeAllOccurences(final int[] array, final int element) { + return null; + } + + public static long[] removeAllOccurences(final long[] array, final long element) { + return null; + } + + public static short[] removeAllOccurences(final short[] array, final short element) { + return null; + } + + public static T[] removeAllOccurences(final T[] array, final T element) { + return null; + } + + public static boolean[] removeAllOccurrences(final boolean[] array, final boolean element) { + return null; + } + + public static byte[] removeAllOccurrences(final byte[] array, final byte element) { + return null; + } + + public static char[] removeAllOccurrences(final char[] array, final char element) { + return null; + } + + public static double[] removeAllOccurrences(final double[] array, final double element) { + return null; + } + + public static float[] removeAllOccurrences(final float[] array, final float element) { + return null; + } + + public static int[] removeAllOccurrences(final int[] array, final int element) { + return null; + } + + public static long[] removeAllOccurrences(final long[] array, final long element) { + return null; + } + + public static short[] removeAllOccurrences(final short[] array, final short element) { + return null; + } + + public static T[] removeAllOccurrences(final T[] array, final T element) { + return null; + } + + public static boolean[] removeElement(final boolean[] array, final boolean element) { + return null; + } + + public static byte[] removeElement(final byte[] array, final byte element) { + return null; + } + + public static char[] removeElement(final char[] array, final char element) { + return null; + } + + public static double[] removeElement(final double[] array, final double element) { + return null; + } + + public static float[] removeElement(final float[] array, final float element) { + return null; + } + + public static int[] removeElement(final int[] array, final int element) { + return null; + } + + public static long[] removeElement(final long[] array, final long element) { + return null; + } + + public static short[] removeElement(final short[] array, final short element) { + return null; + } + + public static T[] removeElement(final T[] array, final Object element) { + return null; + } + + public static boolean[] removeElements(final boolean[] array, final boolean... values) { + return null; + } + + public static byte[] removeElements(final byte[] array, final byte... values) { + return null; + } + + public static char[] removeElements(final char[] array, final char... values) { + return null; + } + + public static double[] removeElements(final double[] array, final double... values) { + return null; + } + + public static float[] removeElements(final float[] array, final float... values) { + return null; + } + + public static int[] removeElements(final int[] array, final int... values) { + return null; + } + + public static long[] removeElements(final long[] array, final long... values) { + return null; + } + + public static short[] removeElements(final short[] array, final short... values) { + return null; + } + + public static T[] removeElements(final T[] array, final T... values) { + return null; + } + + public static void reverse(final boolean[] array) { + } + + public static void reverse(final boolean[] array, final int startIndexInclusive, final int endIndexExclusive) { + } + + public static void reverse(final byte[] array) { + } + + public static void reverse(final byte[] array, final int startIndexInclusive, final int endIndexExclusive) { + } + + public static void reverse(final char[] array) { + } + + public static void reverse(final char[] array, final int startIndexInclusive, final int endIndexExclusive) { + } + + public static void reverse(final double[] array) { + } + + public static void reverse(final double[] array, final int startIndexInclusive, final int endIndexExclusive) { + } + + public static void reverse(final float[] array) { + } + + public static void reverse(final float[] array, final int startIndexInclusive, final int endIndexExclusive) { + } + + public static void reverse(final int[] array) { + } + + public static void reverse(final int[] array, final int startIndexInclusive, final int endIndexExclusive) { + } + + public static void reverse(final long[] array) { + } + + public static void reverse(final long[] array, final int startIndexInclusive, final int endIndexExclusive) { + } + + public static void reverse(final Object[] array) { + } + + public static void reverse(final Object[] array, final int startIndexInclusive, final int endIndexExclusive) { + } + + public static void reverse(final short[] array) { + } + + public static void reverse(final short[] array, final int startIndexInclusive, final int endIndexExclusive) { + } + + public static void shift(final boolean[] array, final int offset) { + } + + public static void shift(final boolean[] array, int startIndexInclusive, int endIndexExclusive, int offset) { + } + + public static void shift(final byte[] array, final int offset) { + } + + public static void shift(final byte[] array, int startIndexInclusive, int endIndexExclusive, int offset) { + } + + public static void shift(final char[] array, final int offset) { + } + + public static void shift(final char[] array, int startIndexInclusive, int endIndexExclusive, int offset) { + } + + public static void shift(final double[] array, final int offset) { + } + + public static void shift(final double[] array, int startIndexInclusive, int endIndexExclusive, int offset) { + } + + public static void shift(final float[] array, final int offset) { + } + + public static void shift(final float[] array, int startIndexInclusive, int endIndexExclusive, int offset) { + } + + public static void shift(final int[] array, final int offset) { + } + + public static void shift(final int[] array, int startIndexInclusive, int endIndexExclusive, int offset) { + } + + public static void shift(final long[] array, final int offset) { + } + + public static void shift(final long[] array, int startIndexInclusive, int endIndexExclusive, int offset) { + } + + public static void shift(final Object[] array, final int offset) { + } + + public static void shift(final Object[] array, int startIndexInclusive, int endIndexExclusive, int offset) { + } + + public static void shift(final short[] array, final int offset) { + } + + public static void shift(final short[] array, int startIndexInclusive, int endIndexExclusive, int offset) { + } + + public static void shuffle(final boolean[] array) { + } + + public static void shuffle(final boolean[] array, final Random random) { + } + + public static void shuffle(final byte[] array) { + } + + public static void shuffle(final byte[] array, final Random random) { + } + + public static void shuffle(final char[] array) { + } + + public static void shuffle(final char[] array, final Random random) { + } + + public static void shuffle(final double[] array) { + } + + public static void shuffle(final double[] array, final Random random) { + } + + public static void shuffle(final float[] array) { + } + + public static void shuffle(final float[] array, final Random random) { + } + + public static void shuffle(final int[] array) { + } + + public static void shuffle(final int[] array, final Random random) { + } + + public static void shuffle(final long[] array) { + } + + public static void shuffle(final long[] array, final Random random) { + } + + public static void shuffle(final Object[] array) { + } + + public static void shuffle(final Object[] array, final Random random) { + } + + public static void shuffle(final short[] array) { + } + + public static void shuffle(final short[] array, final Random random) { + } + + public static boolean[] subarray(final boolean[] array, int startIndexInclusive, int endIndexExclusive) { + return null; + } + + public static byte[] subarray(final byte[] array, int startIndexInclusive, int endIndexExclusive) { + return null; + } + + public static char[] subarray(final char[] array, int startIndexInclusive, int endIndexExclusive) { + return null; + } + + public static double[] subarray(final double[] array, int startIndexInclusive, int endIndexExclusive) { + return null; + } + + public static float[] subarray(final float[] array, int startIndexInclusive, int endIndexExclusive) { + return null; + } + + public static int[] subarray(final int[] array, int startIndexInclusive, int endIndexExclusive) { + return null; + } + + public static long[] subarray(final long[] array, int startIndexInclusive, int endIndexExclusive) { + return null; + } + + public static short[] subarray(final short[] array, int startIndexInclusive, int endIndexExclusive) { + return null; + } + + public static T[] subarray(final T[] array, int startIndexInclusive, int endIndexExclusive) { + return null; + } + + public static void swap(final boolean[] array, final int offset1, final int offset2) { + } + + public static void swap(final boolean[] array, int offset1, int offset2, int len) { + } + + public static void swap(final byte[] array, final int offset1, final int offset2) { + } + + public static void swap(final byte[] array, int offset1, int offset2, int len) { + } + + public static void swap(final char[] array, final int offset1, final int offset2) { + } + + public static void swap(final char[] array, int offset1, int offset2, int len) { + } + + public static void swap(final double[] array, final int offset1, final int offset2) { + } + + public static void swap(final double[] array, int offset1, int offset2, int len) { + } + + public static void swap(final float[] array, final int offset1, final int offset2) { + } + + public static void swap(final float[] array, int offset1, int offset2, int len) { + } + + public static void swap(final int[] array, final int offset1, final int offset2) { + } + + public static void swap(final int[] array, int offset1, int offset2, int len) { + } + + public static void swap(final long[] array, final int offset1, final int offset2) { + } + + public static void swap(final long[] array, int offset1, int offset2, int len) { + } + + public static void swap(final Object[] array, final int offset1, final int offset2) { + } + + public static void swap(final Object[] array, int offset1, int offset2, int len) { + } + + public static void swap(final short[] array, final int offset1, final int offset2) { + } + + public static void swap(final short[] array, int offset1, int offset2, int len) { + } + + public static T[] toArray(@SuppressWarnings("unchecked") final T... items) { + return null; + } + + public static Map toMap(final Object[] array) { + return null; + } + + public static Boolean[] toObject(final boolean[] array) { + return null; + } + + public static Byte[] toObject(final byte[] array) { + return null; + } + + public static Character[] toObject(final char[] array) { + return null; + } + + public static Double[] toObject(final double[] array) { + return null; + } + + public static Float[] toObject(final float[] array) { + return null; + } + + public static Integer[] toObject(final int[] array) { + return null; + } + + public static Long[] toObject(final long[] array) { + return null; + } + + public static Short[] toObject(final short[] array) { + return null; + } + + public static boolean[] toPrimitive(final Boolean[] array) { + return null; + } + + public static boolean[] toPrimitive(final Boolean[] array, final boolean valueForNull) { + return null; + } + + public static byte[] toPrimitive(final Byte[] array) { + return null; + } + + public static byte[] toPrimitive(final Byte[] array, final byte valueForNull) { + return null; + } + + public static char[] toPrimitive(final Character[] array) { + return null; + } + + public static char[] toPrimitive(final Character[] array, final char valueForNull) { + return null; + } + + public static double[] toPrimitive(final Double[] array) { + return null; + } + + public static double[] toPrimitive(final Double[] array, final double valueForNull) { + return null; + } + + public static float[] toPrimitive(final Float[] array) { + return null; + } + + public static float[] toPrimitive(final Float[] array, final float valueForNull) { + return null; + } + + public static int[] toPrimitive(final Integer[] array) { + return null; + } + + public static int[] toPrimitive(final Integer[] array, final int valueForNull) { + return null; + } + + public static long[] toPrimitive(final Long[] array) { + return null; + } + + public static long[] toPrimitive(final Long[] array, final long valueForNull) { + return null; + } + + public static Object toPrimitive(final Object array) { + return null; + } + + public static short[] toPrimitive(final Short[] array) { + return null; + } + + public static short[] toPrimitive(final Short[] array, final short valueForNull) { + return null; + } + + public static String toString(final Object array) { + return null; + } + + public static String toString(final Object array, final String stringIfNull) { + return null; + } + + public static String[] toStringArray(final Object[] array) { + return null; + } + + public static String[] toStringArray(final Object[] array, final String valueForNullElements) { + return null; + } + + public ArrayUtils() { + } + +}