From 22b99a90ded0070ea02c7f2e9b753fac0d6e2e0a Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Sat, 28 Apr 2018 10:36:41 +0200 Subject: [PATCH] Polish See gh-12906 --- .../boot/autoconfigure/session/SessionProperties.java | 11 +++++------ .../src/main/asciidoc/spring-boot-features.adoc | 3 ++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionProperties.java index f75e44cf3c..6f9cebf67a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionProperties.java @@ -65,8 +65,7 @@ public class SessionProperties { @PostConstruct public void checkSessionTimeout() { if (this.timeout == null && this.serverProperties != null) { - Session session = this.serverProperties.getServlet().getSession(); - this.timeout = (session == null ? null : session.getTimeout()); + this.timeout = this.serverProperties.getServlet().getSession().getTimeout(); } } @@ -87,6 +86,10 @@ public class SessionProperties { return this.timeout; } + public void setTimeout(Duration timeout) { + this.timeout = timeout; + } + public Servlet getServlet() { return this.servlet; } @@ -95,10 +98,6 @@ public class SessionProperties { this.servlet = servlet; } - public void setTimeout(Duration timeout) { - this.timeout = timeout; - } - /** * Servlet-related properties. */ diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 38a2fe917e..860870b865 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -6015,7 +6015,8 @@ the name of the table for the JDBC store, as shown in the following example: ---- For setting the timeout of the session you can use the `spring.session.timeout` property. -If that property is not set, the auto-configuration will fallback to the value of `server.servlet.session.timeout`. +If that property is not set, the auto-configuration fallbacks to the value of +`server.servlet.session.timeout`. [[boot-features-jmx]] == Monitoring and Management over JMX