Skip to content

Commit 7271dfe

Browse files
committed
Use CopyOnWriteArrayList for beforeCommit actions
Closes gh-27587
1 parent a2f2f7c commit 7271dfe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spring-web/src/main/java/org/springframework/http/server/reactive/AbstractServerHttpResponse.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 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.http.server.reactive;
1818

19-
import java.util.ArrayList;
2019
import java.util.List;
20+
import java.util.concurrent.CopyOnWriteArrayList;
2121
import java.util.concurrent.atomic.AtomicBoolean;
2222
import java.util.concurrent.atomic.AtomicReference;
2323
import java.util.function.Supplier;
@@ -69,7 +69,7 @@ private enum State {NEW, COMMITTING, COMMIT_ACTION_FAILED, COMMITTED}
6969

7070
private final AtomicReference<State> state = new AtomicReference<>(State.NEW);
7171

72-
private final List<Supplier<? extends Mono<Void>>> commitActions = new ArrayList<>(4);
72+
private final List<Supplier<? extends Mono<Void>>> commitActions = new CopyOnWriteArrayList<>();
7373

7474
@Nullable
7575
private HttpHeaders readOnlyHeaders;

0 commit comments

Comments
 (0)