mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 17:03:12 +07:00
make EmptyList compatible with java.utilCollections.EmptyList
This commit is contained in:
@@ -314,6 +314,34 @@ public class ContainerUtilRt {
|
||||
public Iterator<T> iterator() {
|
||||
return EmptyIterator.getInstance();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ListIterator<T> listIterator() {
|
||||
return EmptyListIterator.getInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsAll(Collection<?> c) {
|
||||
return c.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Contract(pure = true)
|
||||
public boolean isEmpty() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Contract(pure = true)
|
||||
public boolean equals(Object o) {
|
||||
return (o instanceof List) && ((List)o).isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user