Skip to content

Commit e49198d

Browse files
committed
Polishing
1 parent 13c7354 commit e49198d

File tree

9 files changed

+19
-15
lines changed

9 files changed

+19
-15
lines changed

spring-web/src/main/java/org/springframework/web/server/adapter/AbstractReactiveWebInitializer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.springframework.web.server.adapter;
1718

1819
import javax.servlet.ServletContext;

spring-web/src/main/java/org/springframework/web/server/handler/DefaultWebFilterChain.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.springframework.web.server.handler;
1718

1819
import java.util.Arrays;

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2018 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.
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.springframework.web.server.session;
1718

1819
import java.time.Duration;
@@ -45,7 +46,7 @@ public class CookieWebSessionIdResolver implements WebSessionIdResolver {
4546
* @param cookieName the cookie name
4647
*/
4748
public void setCookieName(String cookieName) {
48-
Assert.hasText(cookieName, "'cookieName' must not be empty.");
49+
Assert.hasText(cookieName, "'cookieName' must not be empty");
4950
this.cookieName = cookieName;
5051
}
5152

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 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.
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.springframework.web.server.session;
1718

1819
import java.util.List;
@@ -24,7 +25,6 @@
2425
import org.springframework.web.server.ServerWebExchange;
2526
import org.springframework.web.server.WebSession;
2627

27-
2828
/**
2929
* Default implementation of {@link WebSessionManager} delegating to a
3030
* {@link WebSessionIdResolver} for session id resolution and to a
@@ -47,7 +47,7 @@ public class DefaultWebSessionManager implements WebSessionManager {
4747
* @param sessionIdResolver the resolver to use
4848
*/
4949
public void setSessionIdResolver(WebSessionIdResolver sessionIdResolver) {
50-
Assert.notNull(sessionIdResolver, "WebSessionIdResolver is required.");
50+
Assert.notNull(sessionIdResolver, "WebSessionIdResolver is required");
5151
this.sessionIdResolver = sessionIdResolver;
5252
}
5353

@@ -64,7 +64,7 @@ public WebSessionIdResolver getSessionIdResolver() {
6464
* @param sessionStore the persistence strategy to use
6565
*/
6666
public void setSessionStore(WebSessionStore sessionStore) {
67-
Assert.notNull(sessionStore, "WebSessionStore is required.");
67+
Assert.notNull(sessionStore, "WebSessionStore is required");
6868
this.sessionStore = sessionStore;
6969
}
7070

@@ -90,7 +90,6 @@ private Mono<WebSession> retrieveSession(ServerWebExchange exchange) {
9090
}
9191

9292
private Mono<Void> save(ServerWebExchange exchange, WebSession session) {
93-
9493
List<String> ids = getSessionIdResolver().resolveSessionIds(exchange);
9594

9695
if (!session.isStarted() || session.isExpired()) {
@@ -107,4 +106,5 @@ private Mono<Void> save(ServerWebExchange exchange, WebSession session) {
107106

108107
return session.save();
109108
}
109+
110110
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 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.
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.springframework.web.server.session;
1718

1819
import java.util.Collections;
@@ -46,7 +47,7 @@ public class HeaderWebSessionIdResolver implements WebSessionIdResolver {
4647
* @param headerName the header name
4748
*/
4849
public void setHeaderName(String headerName) {
49-
Assert.hasText(headerName, "'headerName' must not be empty.");
50+
Assert.hasText(headerName, "'headerName' must not be empty");
5051
this.headerName = headerName;
5152
}
5253

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 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.
@@ -89,9 +89,7 @@ public Mono<WebSession> createWebSession() {
8989

9090
@Override
9191
public Mono<WebSession> retrieveSession(String id) {
92-
9392
Instant currentTime = Instant.now(this.clock);
94-
9593
if (!this.sessions.isEmpty() && !currentTime.isBefore(this.nextExpirationCheckTime)) {
9694
checkExpiredSessions(currentTime);
9795
}
@@ -159,13 +157,11 @@ private class InMemoryWebSession implements WebSession {
159157

160158
private final AtomicReference<State> state = new AtomicReference<>(State.NEW);
161159

162-
163160
public InMemoryWebSession() {
164161
this.creationTime = Instant.now(getClock());
165162
this.lastAccessTime = this.creationTime;
166163
}
167164

168-
169165
@Override
170166
public String getId() {
171167
return this.id.get();
@@ -259,6 +255,7 @@ private void updateLastAccessTime(Instant currentTime) {
259255
}
260256
}
261257

258+
262259
private enum State { NEW, STARTED, EXPIRED }
263260

264261
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.springframework.web.server.session;
1718

1819
import java.util.List;
1920

2021
import org.springframework.web.server.ServerWebExchange;
2122

22-
2323
/**
2424
* Contract for session id resolution strategies. Allows for session id
2525
* resolution through the request and for sending the session id or expiring

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.springframework.web.server.session;
1718

1819
import reactor.core.publisher.Mono;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.springframework.web.server.session;
1718

1819
import reactor.core.publisher.Mono;
@@ -61,4 +62,5 @@ public interface WebSessionStore {
6162
* @return the session with the updated last access time
6263
*/
6364
Mono<WebSession> updateLastAccessTime(WebSession webSession);
65+
6466
}

0 commit comments

Comments
 (0)