From 922d4d217bd02d75b9d1d1dcaf037a7e015683f7 Mon Sep 17 00:00:00 2001 From: Marco Brandizi Date: Fri, 27 Oct 2023 11:16:40 +0200 Subject: [PATCH] batchproc, minimal code readability improvements. --- .../uk/ac/ebi/utils/threading/batchproc/BatchCollector.java | 6 +++--- .../batchproc/collectors/CollectionBatchCollector.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/uk/ac/ebi/utils/threading/batchproc/BatchCollector.java b/src/main/java/uk/ac/ebi/utils/threading/batchproc/BatchCollector.java index 50b889a37..b7aac3619 100644 --- a/src/main/java/uk/ac/ebi/utils/threading/batchproc/BatchCollector.java +++ b/src/main/java/uk/ac/ebi/utils/threading/batchproc/BatchCollector.java @@ -7,12 +7,12 @@ /** * ## The Batch Collector * - * A batch collector is a container of methods to manage matches during the operations of + * A batch collector is a container of methods to manage batches during the operations of * {@link BatchProcessor}. This default interface offers a {@link #batchFactory() batch factory}, used * to obtain a new batch when needed, and a {@link #batchReadyFlag() ready flag}, which establishes if - * a batch is ready for being processed (eg, it's full wrt o a given size). + * a batch is ready for being processed (eg, it's full wrt a given size). * - * Significant specific sub-interface are the {@link SizedBatchCollector sized-based collectors}, the + * Significant specific sub-interfaces are the {@link SizedBatchCollector sized-based collectors}, the * {@link ItemizedSizedBatchCollector item-based one} and their {@link ItemizedSizedBatchCollector intersection}. * * Due to some similarity, batch collectors are named after {@link Collector Java stream collectors}. diff --git a/src/main/java/uk/ac/ebi/utils/threading/batchproc/collectors/CollectionBatchCollector.java b/src/main/java/uk/ac/ebi/utils/threading/batchproc/collectors/CollectionBatchCollector.java index d35209c6e..ac60b6a79 100644 --- a/src/main/java/uk/ac/ebi/utils/threading/batchproc/collectors/CollectionBatchCollector.java +++ b/src/main/java/uk/ac/ebi/utils/threading/batchproc/collectors/CollectionBatchCollector.java @@ -45,7 +45,7 @@ public Supplier batchFactory () { @Override public BiConsumer accumulator () { - return (coll,elem) -> coll.add ( elem ); + return C::add; } @Override