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

Method copyOf

corpus/java/training/guava/collect/ImmutableList.java:209–214  ·  view source on GitHub ↗

Returns an immutable list containing the given elements, in order. If elements is a Collection, this method behaves exactly as #copyOf(Collection); otherwise, it behaves exactly as copyOf(elements.iterator(). @throws NullPointerException if any of elements is

(Iterable<? extends E> elements)

Source from the content-addressed store, hash-verified

207 * @throws NullPointerException if any of {@code elements} is null
208 */
209 public static <E> ImmutableList<E> copyOf(Iterable<? extends E> elements) {
210 checkNotNull(elements); // TODO(kevinb): is this here only for GWT?
211 return (elements instanceof Collection)
212 ? copyOf((Collection<? extends E>) elements)
213 : copyOf(elements.iterator());
214 }
215
216 /**
217 * Returns an immutable list containing the given elements, in order.

Callers 15

parseMethod · 0.95
copyOfMethod · 0.95
concatMethod · 0.95
CompoundOrderingMethod · 0.95
immutableSortedCopyMethod · 0.95
computeNextMethod · 0.95
permutationsMethod · 0.95
computeNextMethod · 0.95
concatMethod · 0.95
toListMethod · 0.95
copyOfSortedMethod · 0.95
ArrayTableMethod · 0.95

Calls 15

asImmutableListMethod · 0.95
constructMethod · 0.95
ofMethod · 0.95
iteratorMethod · 0.65
nextMethod · 0.65
addAllMethod · 0.65
addMethod · 0.65
checkNotNullMethod · 0.45
asListMethod · 0.45
isPartialViewMethod · 0.45
toArrayMethod · 0.45
hasNextMethod · 0.45

Tested by

no test coverage detected