Remove out of date and unhelpful comments. Project: http://git-wip-us.apache.org/repos/asf/jena/repo Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/3d5909e3 Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/3d5909e3 Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/3d5909e3
Branch: refs/heads/master Commit: 3d5909e3bc71d101b80038c3706f539ee2573cab Parents: bd9fdd2 Author: Andy Seaborne <[email protected]> Authored: Tue Dec 29 11:26:26 2015 +0000 Committer: Andy Seaborne <[email protected]> Committed: Tue Dec 29 21:13:05 2015 +0000 ---------------------------------------------------------------------- .../org/apache/jena/atlas/lib/ArrayUtils.java | 34 ++++---------------- 1 file changed, 7 insertions(+), 27 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/jena/blob/3d5909e3/jena-base/src/main/java/org/apache/jena/atlas/lib/ArrayUtils.java ---------------------------------------------------------------------- diff --git a/jena-base/src/main/java/org/apache/jena/atlas/lib/ArrayUtils.java b/jena-base/src/main/java/org/apache/jena/atlas/lib/ArrayUtils.java index d45a107..200b82c 100644 --- a/jena-base/src/main/java/org/apache/jena/atlas/lib/ArrayUtils.java +++ b/jena-base/src/main/java/org/apache/jena/atlas/lib/ArrayUtils.java @@ -28,37 +28,17 @@ public class ArrayUtils /** Allocate an array of generic type T (initialized to null) */ @SuppressWarnings("unchecked") - public static <T> T[] alloc(Class<T> cls, int n) - { - return (T[])Array.newInstance(cls, n) ; + public static <T> T[] alloc(Class<T> cls, int n) { + return (T[])Array.newInstance(cls, n); } - - // Compiles but fails at runtime (class cast exception if the reuls is assigned or accessed) -// @SuppressWarnings("unchecked") -// T[] array = (T[])new Object[n] ; -// or is T known -// @SuppressWarnings("unchecked") -// Set<T> x[] = new Set[length] ; -// return array ; - - /** Allocation space and copy */ - public static <T> T[] copy(T[] array) - { - return copy(array, 0, array.length) ; + + /** Allocation space and copy */ + public static <T> T[] copy(T[] array) { + return copy(array, 0, array.length); } /** Allocation space and copy */ - public static <T> T[] copy(T[] array, int start, int finish) - { + public static <T> T[] copy(T[] array, int start, int finish) { return Arrays.copyOfRange(array, start, finish) ; - -// // Java5. -// // Fails for arrays of length 0; -// if ( array.length <= start ) -// throw new IllegalArgumentException("Zero length array not supported") ; -// @SuppressWarnings("unchecked") -// T[] array2 = (T[])Array.newInstance(array[start].getClass(), finish-start) ; -// System.arraycopy(array, start, array2, 0, finish-start) ; -// return array2 ; } }
