Skip to content

Commit c8d1dfe

Browse files
dugenkui03wilkinsona
authored andcommitted
Make event handling in JobExecutionExitCodeGenerator thread-safe
See gh-30705
1 parent 7cf37ca commit c8d1dfe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobExecutionExitCodeGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
package org.springframework.boot.autoconfigure.batch;
1818

19-
import java.util.ArrayList;
2019
import java.util.List;
20+
import java.util.concurrent.CopyOnWriteArrayList;
2121

2222
import org.springframework.batch.core.JobExecution;
2323
import org.springframework.boot.ExitCodeGenerator;
@@ -31,7 +31,7 @@
3131
*/
3232
public class JobExecutionExitCodeGenerator implements ApplicationListener<JobExecutionEvent>, ExitCodeGenerator {
3333

34-
private final List<JobExecution> executions = new ArrayList<>();
34+
private final List<JobExecution> executions = new CopyOnWriteArrayList<>();
3535

3636
@Override
3737
public void onApplicationEvent(JobExecutionEvent event) {

0 commit comments

Comments
 (0)