Skip to content

Commit

Permalink
Migrate toward java.util.function
Browse files Browse the repository at this point in the history
- Package-private changes only
- Maintains binary and source compatibility
  • Loading branch information
garydgregory committed Jul 11, 2024
1 parent 7ec4e0c commit 54cc2a9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ public static <O, R extends Collection<O>> List<R> partition(final Iterable<? ex

if (predicates.length < 1) {
// return the entire input collection as a single partition
final R singlePartition = partitionFactory.create();
final R singlePartition = partitionFactory.get();
CollectionUtils.addAll(singlePartition, iterable);
return Collections.singletonList(singlePartition);
}
Expand All @@ -688,7 +688,7 @@ public static <O, R extends Collection<O>> List<R> partition(final Iterable<? ex
final int numberOfPartitions = numberOfPredicates + 1;
final List<R> partitions = new ArrayList<>(numberOfPartitions);
for (int i = 0; i < numberOfPartitions; ++i) {
partitions.add(partitionFactory.create());
partitions.add(partitionFactory.get());
}

// for each element in inputCollection:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public T transform(final T input) {
if (input == null) {
return null;
}
return PrototypeFactory.prototypeFactory(input).create();
return PrototypeFactory.prototypeFactory(input).get();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public Factory<? extends O> getFactory() {
*/
@Override
public O transform(final I input) {
return iFactory.create();
return iFactory.get();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ protected LazyList(final List<E> list, final Transformer<Integer, ? extends E> t

private E element(final int index) {
if (factory != null) {
return factory.create();
return factory.get();
}
if (transformer != null) {
return transformer.transform(index);
Expand Down

0 comments on commit 54cc2a9

Please sign in to comment.