Replace single operations inside loops with bulk methods
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user