Replace unmodifiable collection creation with collection factory methods

This commit is contained in:
Mahmoud Ben Hassine
2023-06-12 15:42:02 +02:00
parent cb1b68d165
commit a2be6ba0c3
3 changed files with 17 additions and 19 deletions

View File

@@ -103,7 +103,7 @@ public class Chunk<W> implements Iterable<W>, Serializable {
* @return a copy of the items to be processed as an unmodifiable list
*/
public List<W> getItems() {
return Collections.unmodifiableList(new ArrayList<>(items));
return List.copyOf(items);
}
/**