Skip to content

Commit e08483f

Browse files
committed
Merge pull request #30705 from dugenkui03
* gh-30705: Polish "Make event handling in JobExecutionExitCodeGenerator thread-safe" Make event handling in JobExecutionExitCodeGenerator thread-safe Closes gh-30705
2 parents 7cf37ca + 026b9e2 commit e08483f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -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)