mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
Added more to the avian classpath for the collection interface as well as the list interface
Added to collection: public boolean containsAll(Collection<?> c); public boolean removeAll(Collection<?> c); Added to list: public boolean addAll(int startIndex, Collection<? extends T> c); Also where possible for inner classes I made them extend the abstract version instead of just implement the interface. This helps reduce code duplication where possible. These changes were necessary to support protobuf 2.5.0
This commit is contained in:
@ -170,6 +170,14 @@ public class Collections {
|
||||
public Iterator<T> iterator() {
|
||||
return new SynchronizedIterator(lock, collection.iterator());
|
||||
}
|
||||
|
||||
public boolean containsAll(Collection<?> c) {
|
||||
synchronized (lock) { return collection.containsAll(c); }
|
||||
}
|
||||
|
||||
public boolean removeAll(Collection<?> c) {
|
||||
synchronized (lock) { return collection.removeAll(c); }
|
||||
}
|
||||
}
|
||||
|
||||
static class SynchronizedMap<K,V> implements Map<K,V> {
|
||||
@ -393,6 +401,18 @@ public class Collections {
|
||||
public void clear() {
|
||||
throw new UnsupportedOperationException("not supported");
|
||||
}
|
||||
|
||||
public boolean removeAll(Collection<?> c) {
|
||||
throw new UnsupportedOperationException("not supported");
|
||||
}
|
||||
|
||||
public boolean addAll(int startIndex, Collection<? extends T> c) {
|
||||
throw new UnsupportedOperationException("not supported");
|
||||
}
|
||||
|
||||
public boolean containsAll(Collection<?> c) {
|
||||
return inner.containsAll(c);
|
||||
}
|
||||
}
|
||||
|
||||
public static <K,V> Map<K,V> unmodifiableMap(Map<K,V> m) {
|
||||
@ -500,6 +520,14 @@ public class Collections {
|
||||
|
||||
public <S> S[] toArray(S[] array) {
|
||||
return inner.toArray(array);
|
||||
}
|
||||
|
||||
public boolean containsAll(Collection<?> c) {
|
||||
return inner.containsAll(c);
|
||||
}
|
||||
|
||||
public boolean removeAll(Collection<?> c) {
|
||||
throw new UnsupportedOperationException("not supported");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user