Change from arrayList to immutableList in OrderedComposite#iterator

(cherry picked from commit d9bf57e572)
This commit is contained in:
sjh836
2021-09-15 01:53:48 +09:00
committed by Mahmoud Ben Hassine
parent f7c3af1f90
commit b4cb1f3d56

View File

@@ -83,7 +83,7 @@ class OrderedComposite<S> {
* @return an iterator over the list of items
*/
public Iterator<S> iterator() {
return new ArrayList<>(list).iterator();
return Collections.unmodifiableList(list).iterator();
}
/**