MCPcopy Create free account
hub / github.com/antlr/codebuff / concat

Method concat

corpus/java/training/guava/collect/ObjectArrays.java:72–78  ·  view source on GitHub ↗

Returns a new array that contains the concatenated contents of two arrays. @param first the first array of elements to concatenate @param second the second array of elements to concatenate @param type the component type of the returned array

(T[] first, T[] second, Class<T> type)

Source from the content-addressed store, hash-verified

70 * @param type the component type of the returned array
71 */
72 @GwtIncompatible // Array.newInstance(Class, int)
73 public static <T> T[] concat(T[] first, T[] second, Class<T> type) {
74 T[] result = newArray(type, first.length + second.length);
75 System.arraycopy(first, 0, result, 0, first.length);
76 System.arraycopy(second, 0, result, first.length, second.length);
77 return result;
78 }
79
80 /**
81 * Returns a new array that prepends {@code element} to {@code array}.

Callers 1

throwCauseMethod · 0.95

Calls 2

newArrayMethod · 0.95
arraysCopyOfMethod · 0.95

Tested by

no test coverage detected