equal
deleted
inserted
replaced
80 @Override public boolean removeIf(Predicate<? super E> filter) { throw uoe(); } |
80 @Override public boolean removeIf(Predicate<? super E> filter) { throw uoe(); } |
81 @Override public boolean retainAll(Collection<?> c) { throw uoe(); } |
81 @Override public boolean retainAll(Collection<?> c) { throw uoe(); } |
82 } |
82 } |
83 |
83 |
84 // ---------- List Implementations ---------- |
84 // ---------- List Implementations ---------- |
|
85 |
|
86 // make a copy, short-circuiting based on implementation class |
|
87 @SuppressWarnings("unchecked") |
|
88 static <E> List<E> listCopy(Collection<? extends E> coll) { |
|
89 if (coll instanceof AbstractImmutableList && coll.getClass() != SubList.class) { |
|
90 return (List<E>)coll; |
|
91 } else { |
|
92 return (List<E>)List.of(coll.toArray()); |
|
93 } |
|
94 } |
85 |
95 |
86 @SuppressWarnings("unchecked") |
96 @SuppressWarnings("unchecked") |
87 static <E> List<E> emptyList() { |
97 static <E> List<E> emptyList() { |
88 return (List<E>) ListN.EMPTY_LIST; |
98 return (List<E>) ListN.EMPTY_LIST; |
89 } |
99 } |