Summary: This approach was requiring the `InferArray` class to always be part of the classpath, and the only benefit was to preserve the length of the arrays, when known, on calls to `clone()` method. However, adding it to the models would create circular dependencies between the models, the builtins and the tests. The code is now simpler and we can more aggressively fail when classes that are supposed to be found from the classpath are not found. Reviewed By: sblackshear Differential Revision: D5703173 fbshipit-source-id: 3e6cea5master
parent
5ead13a225
commit
1d8d6e3ceb
@ -1,47 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009 - 2013 Monoidics ltd.
|
|
||||||
* Copyright (c) 2013 - present Facebook, Inc.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the BSD style license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.facebook.infer.builtins;
|
|
||||||
|
|
||||||
public class InferArray {
|
|
||||||
|
|
||||||
public static Object[] clone(Object[] arr) {
|
|
||||||
return new Object[arr.length];
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int[] clone(int[] arr) {
|
|
||||||
return new int[arr.length];
|
|
||||||
}
|
|
||||||
|
|
||||||
public static short[] clone(short[] arr) {
|
|
||||||
return new short[arr.length];
|
|
||||||
}
|
|
||||||
|
|
||||||
public static long[] clone(long[] arr) {
|
|
||||||
return new long[arr.length];
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean[] clone(boolean[] arr) {
|
|
||||||
return new boolean[arr.length];
|
|
||||||
}
|
|
||||||
|
|
||||||
public static char[] clone(char[] arr) {
|
|
||||||
return new char[arr.length];
|
|
||||||
}
|
|
||||||
|
|
||||||
public static float[] clone(float[] arr) {
|
|
||||||
return new float[arr.length];
|
|
||||||
}
|
|
||||||
|
|
||||||
public static double[] clone(double[] arr) {
|
|
||||||
return new double[arr.length];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in new issue