diff --git a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/tunnel/server/HttpTunnelServer.java b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/tunnel/server/HttpTunnelServer.java index 829e87bf5f..fe1ee9673c 100644 --- a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/tunnel/server/HttpTunnelServer.java +++ b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/tunnel/server/HttpTunnelServer.java @@ -274,8 +274,8 @@ public class HttpTunnelServer { } private void closeStaleHttpConnections() throws IOException { - checkNotDisconnected(); synchronized (this.httpConnections) { + checkNotDisconnected(); Iterator iterator = this.httpConnections.iterator(); while (iterator.hasNext()) { HttpConnection httpConnection = iterator.next();