diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobExecutionExitCodeGenerator.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobExecutionExitCodeGenerator.java index 28f2d3b1415..c2038935ab2 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobExecutionExitCodeGenerator.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobExecutionExitCodeGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2022 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. @@ -16,8 +16,8 @@ package org.springframework.boot.autoconfigure.batch; -import java.util.ArrayList; import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; import org.springframework.batch.core.JobExecution; import org.springframework.boot.ExitCodeGenerator; @@ -31,7 +31,7 @@ import org.springframework.context.ApplicationListener; */ public class JobExecutionExitCodeGenerator implements ApplicationListener, ExitCodeGenerator { - private final List executions = new ArrayList<>(); + private final List executions = new CopyOnWriteArrayList<>(); @Override public void onApplicationEvent(JobExecutionEvent event) {