rishabhdaim commented on code in PR #2111:
URL: https://github.com/apache/jackrabbit-oak/pull/2111#discussion_r1967232911


##########
oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/collections/IterableUtils.java:
##########
@@ -212,4 +214,46 @@ public static <T> T[] toArray(final Iterable<T> itr, final 
Class<T> type) {
         final Collection<T> collection = itr instanceof Collection ? 
(Collection<T>) itr : ListUtils.toList(itr);
         return collection.toArray(t);
     }
+
+    /**
+     * Splits an Iterable into an Iterator of sub-iterators, each of the 
specified size.
+     *
+     * @param <T> the type of elements in the itr
+     * @param itr the itr to split, may not be null
+     * @param size the size of each sub-iterator, must be greater than 0
+     * @return an iterator of sub-iterators, each of the specified size
+     * @throws NullPointerException if the itr is null
+     * @throws IllegalArgumentException if size is less than or equal to 0
+     */
+    public static <T> Iterable<List<T>> partition(final Iterable<T> itr, final 
int size) {
+        if (itr == null) {

Review Comment:
   addressed in 
https://github.com/apache/jackrabbit-oak/pull/2111/commits/8103c0116fc53d00436f65a5a0f2339b6c9b3ff0



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: oak-dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to