MCPcopy Index your code
hub / github.com/assertj/assertj / asList

Method asList

src/main/java/org/assertj/core/internal/Arrays.java:539–549  ·  view source on GitHub ↗
(Object array)

Source from the content-addressed store, hash-verified

537 }
538
539 @SuppressWarnings("unchecked")
540 private static <T> List<T> asList(Object array) {
541 if (array == null) return null;
542 if (!isArray(array)) throw new IllegalArgumentException("The object should be an array");
543 int length = getLength(array);
544 List<T> list = new ArrayList<T>(length);
545 for (int i = 0; i < length; i++) {
546 list.add((T) Array.get(array, i));
547 }
548 return list;
549 }
550
551 @SuppressWarnings("unchecked")
552 private static Comparable<Object>[] arrayOfComparableItems(Object array) {

Calls 2

isArrayMethod · 0.95
getMethod · 0.45