Skip to content

Commit 19a9bc4

Browse files
committed
Remove unnecessary assertion
Issue: SPR-16201
1 parent 6e05a58 commit 19a9bc4

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

spring-web/src/main/java/org/springframework/web/server/session/InMemoryWebSessionStore.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public class InMemoryWebSessionStore implements WebSessionStore {
4646
/** Minimum period between expiration checks */
4747
private static final Duration EXPIRATION_CHECK_PERIOD = Duration.ofSeconds(60);
4848

49-
5049
private static final IdGenerator idGenerator = new JdkIdGenerator();
5150

5251

@@ -210,11 +209,7 @@ public boolean isStarted() {
210209
@Override
211210
public Mono<Void> changeSessionId() {
212211
String currentId = this.id.get();
213-
if (InMemoryWebSessionStore.this.sessions.remove(currentId) == null) {
214-
return Mono.error(new IllegalStateException(
215-
"Failed to change session id: " + currentId +
216-
" because the Session is no longer present in the store."));
217-
}
212+
InMemoryWebSessionStore.this.sessions.remove(currentId);
218213
String newId = String.valueOf(idGenerator.generateId());
219214
this.id.set(newId);
220215
InMemoryWebSessionStore.this.sessions.put(this.getId(), this);

0 commit comments

Comments
 (0)