We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 213b150 commit f0bbb97Copy full SHA for f0bbb97
src/main/java/de/rwth/idsg/steve/ocpp/ws/SessionContextStoreImpl.java
@@ -142,7 +142,11 @@ public void closeSessions(String chargeBoxId) {
142
if (endpointDeque == null) {
143
return;
144
}
145
- for (SessionContext sessionContext : endpointDeque) {
+
146
+ // To prevent a ConcurrentModificationException, iterate over a copy of
147
+ // endpointDeque when closing sessions. The close() operation can trigger an event
148
+ // that modifies the deque, causing an error.
149
+ for (SessionContext sessionContext : new ArrayDeque<>(endpointDeque)) {
150
try {
151
sessionContext.getSession().close();
152
} catch (IOException e) {
0 commit comments