Replace single operations inside loops with bulk methods

This commit is contained in:
Mahmoud Ben Hassine
2023-06-05 13:14:01 +02:00
parent 6d3e48a0bc
commit 106c4a589d
4 changed files with 13 additions and 28 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2022 the original author or authors.
* Copyright 2006-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -38,6 +39,7 @@ import org.springframework.batch.core.job.flow.StateSupport;
/**
* @author Dave Syer
* @author Michael Minella
* @author Mahmoud Ben Hassine
*
*/
class SimpleFlowTests {
@@ -208,13 +210,7 @@ class SimpleFlowTests {
}
protected List<StateTransition> collect(StateTransition... states) {
List<StateTransition> list = new ArrayList<>();
for (StateTransition stateTransition : states) {
list.add(stateTransition);
}
return list;
return new ArrayList<>(Arrays.asList(states));
}
/**