You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2023/05/31 08:56:57 UTC

[tomcat] branch 10.1.x updated: Code clean-up - formatting. No fucntional change.

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
     new b2ffca7955 Code clean-up - formatting. No fucntional change.
b2ffca7955 is described below

commit b2ffca795594a6641582c09495302fdf23c106c6
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed May 31 09:56:49 2023 +0100

    Code clean-up - formatting. No fucntional change.
---
 java/org/apache/catalina/session/Constants.java    |   8 +-
 .../apache/catalina/session/DataSourceStore.java   | 154 +++---
 java/org/apache/catalina/session/FileStore.java    |  58 +--
 java/org/apache/catalina/session/ManagerBase.java  | 329 ++++++-------
 .../apache/catalina/session/PersistentManager.java |  14 +-
 .../catalina/session/PersistentManagerBase.java    | 379 +++++++--------
 .../apache/catalina/session/StandardManager.java   |  94 ++--
 .../apache/catalina/session/StandardSession.java   | 521 ++++++++-------------
 java/org/apache/catalina/session/StoreBase.java    |  50 +-
 .../session/TooManyActiveSessionsException.java    |   9 +-
 10 files changed, 666 insertions(+), 950 deletions(-)

diff --git a/java/org/apache/catalina/session/Constants.java b/java/org/apache/catalina/session/Constants.java
index 58a8890a8d..3948fe8dc5 100644
--- a/java/org/apache/catalina/session/Constants.java
+++ b/java/org/apache/catalina/session/Constants.java
@@ -24,8 +24,7 @@ import org.apache.catalina.Globals;
 import org.apache.catalina.valves.CrawlerSessionManagerValve;
 
 /**
- * Manifest constants for the <code>org.apache.catalina.session</code>
- * package.
+ * Manifest constants for the <code>org.apache.catalina.session</code> package.
  *
  * @author Craig R. McClanahan
  */
@@ -33,9 +32,8 @@ import org.apache.catalina.valves.CrawlerSessionManagerValve;
 public class Constants {
 
     /**
-     * Set of session attribute names used internally by Tomcat that should
-     * always be removed from the session before it is persisted, replicated or
-     * equivalent.
+     * Set of session attribute names used internally by Tomcat that should always be removed from the session before it
+     * is persisted, replicated or equivalent.
      */
     public static final Set<String> excludedAttributeNames;
 
diff --git a/java/org/apache/catalina/session/DataSourceStore.java b/java/org/apache/catalina/session/DataSourceStore.java
index 1178eac41d..7dd4d91166 100644
--- a/java/org/apache/catalina/session/DataSourceStore.java
+++ b/java/org/apache/catalina/session/DataSourceStore.java
@@ -42,10 +42,8 @@ import org.apache.catalina.Session;
 import org.apache.juli.logging.Log;
 
 /**
- * Implementation of the {@link org.apache.catalina.Store Store}
- * interface that stores serialized session objects in a database.
- * Sessions that are saved are still subject to being expired
- * based on inactivity.
+ * Implementation of the {@link org.apache.catalina.Store Store} interface that stores serialized session objects in a
+ * database. Sessions that are saved are still subject to being expired based on inactivity.
  *
  * @author Bip Thelin
  */
@@ -157,9 +155,7 @@ public class DataSourceStore extends StoreBase {
     public void setSessionTable(String sessionTable) {
         String oldSessionTable = this.sessionTable;
         this.sessionTable = sessionTable;
-        support.firePropertyChange("sessionTable",
-                oldSessionTable,
-                this.sessionTable);
+        support.firePropertyChange("sessionTable", oldSessionTable, this.sessionTable);
     }
 
     /**
@@ -177,9 +173,7 @@ public class DataSourceStore extends StoreBase {
     public void setSessionAppCol(String sessionAppCol) {
         String oldSessionAppCol = this.sessionAppCol;
         this.sessionAppCol = sessionAppCol;
-        support.firePropertyChange("sessionAppCol",
-                oldSessionAppCol,
-                this.sessionAppCol);
+        support.firePropertyChange("sessionAppCol", oldSessionAppCol, this.sessionAppCol);
     }
 
     /**
@@ -197,9 +191,7 @@ public class DataSourceStore extends StoreBase {
     public void setSessionIdCol(String sessionIdCol) {
         String oldSessionIdCol = this.sessionIdCol;
         this.sessionIdCol = sessionIdCol;
-        support.firePropertyChange("sessionIdCol",
-                oldSessionIdCol,
-                this.sessionIdCol);
+        support.firePropertyChange("sessionIdCol", oldSessionIdCol, this.sessionIdCol);
     }
 
     /**
@@ -217,9 +209,7 @@ public class DataSourceStore extends StoreBase {
     public void setSessionDataCol(String sessionDataCol) {
         String oldSessionDataCol = this.sessionDataCol;
         this.sessionDataCol = sessionDataCol;
-        support.firePropertyChange("sessionDataCol",
-                oldSessionDataCol,
-                this.sessionDataCol);
+        support.firePropertyChange("sessionDataCol", oldSessionDataCol, this.sessionDataCol);
     }
 
     /**
@@ -237,9 +227,7 @@ public class DataSourceStore extends StoreBase {
     public void setSessionValidCol(String sessionValidCol) {
         String oldSessionValidCol = this.sessionValidCol;
         this.sessionValidCol = sessionValidCol;
-        support.firePropertyChange("sessionValidCol",
-                oldSessionValidCol,
-                this.sessionValidCol);
+        support.firePropertyChange("sessionValidCol", oldSessionValidCol, this.sessionValidCol);
     }
 
     /**
@@ -257,9 +245,7 @@ public class DataSourceStore extends StoreBase {
     public void setSessionMaxInactiveCol(String sessionMaxInactiveCol) {
         String oldSessionMaxInactiveCol = this.sessionMaxInactiveCol;
         this.sessionMaxInactiveCol = sessionMaxInactiveCol;
-        support.firePropertyChange("sessionMaxInactiveCol",
-                oldSessionMaxInactiveCol,
-                this.sessionMaxInactiveCol);
+        support.firePropertyChange("sessionMaxInactiveCol", oldSessionMaxInactiveCol, this.sessionMaxInactiveCol);
     }
 
     /**
@@ -277,9 +263,7 @@ public class DataSourceStore extends StoreBase {
     public void setSessionLastAccessedCol(String sessionLastAccessedCol) {
         String oldSessionLastAccessedCol = this.sessionLastAccessedCol;
         this.sessionLastAccessedCol = sessionLastAccessedCol;
-        support.firePropertyChange("sessionLastAccessedCol",
-                oldSessionLastAccessedCol,
-                this.sessionLastAccessedCol);
+        support.firePropertyChange("sessionLastAccessedCol", oldSessionLastAccessedCol, this.sessionLastAccessedCol);
     }
 
     /**
@@ -296,8 +280,7 @@ public class DataSourceStore extends StoreBase {
      */
     public void setDataSourceName(String dataSourceName) {
         if (dataSourceName == null || dataSourceName.trim().isEmpty()) {
-            manager.getContext().getLogger().warn(
-                    sm.getString(getStoreName() + ".missingDataSourceName"));
+            manager.getContext().getLogger().warn(sm.getString(getStoreName() + ".missingDataSourceName"));
             return;
         }
         this.dataSourceName = dataSourceName;
@@ -318,13 +301,12 @@ public class DataSourceStore extends StoreBase {
     }
 
     /**
-     * Set to {@code true} to cause the datasource to be looked up in the webapp
-     * JNDI Context.
+     * Set to {@code true} to cause the datasource to be looked up in the webapp JNDI Context.
      *
      * @param localDataSource the new flag value
      */
     public void setLocalDataSource(boolean localDataSource) {
-      this.localDataSource = localDataSource;
+        this.localDataSource = localDataSource;
     }
 
 
@@ -341,12 +323,11 @@ public class DataSourceStore extends StoreBase {
     }
 
     /**
-     * Return an array containing the session identifiers of all Sessions
-     * currently saved in this Store.  If there are no such Sessions, a
-     * zero-length array is returned.
+     * Return an array containing the session identifiers of all Sessions currently saved in this Store. If there are no
+     * such Sessions, a zero-length array is returned.
+     *
+     * @param expiredOnly flag, whether only keys of expired sessions should be returned
      *
-     * @param expiredOnly flag, whether only keys of expired sessions should
-     *        be returned
      * @return array containing the list of session IDs
      *
      * @exception IOException if an input/output error occurred
@@ -362,11 +343,10 @@ public class DataSourceStore extends StoreBase {
             }
             try {
 
-                String keysSql = "SELECT " + sessionIdCol + " FROM "
-                        + sessionTable + " WHERE " + sessionAppCol + " = ?";
+                String keysSql =
+                        "SELECT " + sessionIdCol + " FROM " + sessionTable + " WHERE " + sessionAppCol + " = ?";
                 if (expiredOnly) {
-                    keysSql += " AND (" + sessionLastAccessedCol + " + "
-                            + sessionMaxInactiveCol + " * 1000 < ?)";
+                    keysSql += " AND (" + sessionLastAccessedCol + " + " + sessionMaxInactiveCol + " * 1000 < ?)";
                 }
                 try (PreparedStatement preparedKeysSql = _conn.prepareStatement(keysSql)) {
                     preparedKeysSql.setString(1, getName());
@@ -398,8 +378,7 @@ public class DataSourceStore extends StoreBase {
     }
 
     /**
-     * Return an integer containing a count of all Sessions
-     * currently saved in this Store.  If there are no Sessions,
+     * Return an integer containing a count of all Sessions currently saved in this Store. If there are no Sessions,
      * <code>0</code> is returned.
      *
      * @return the count of all sessions currently saved in this Store
@@ -409,9 +388,7 @@ public class DataSourceStore extends StoreBase {
     @Override
     public int getSize() throws IOException {
         int size = 0;
-        String sizeSql = "SELECT COUNT(" + sessionIdCol
-                + ") FROM " + sessionTable + " WHERE "
-                + sessionAppCol + " = ?";
+        String sizeSql = "SELECT COUNT(" + sessionIdCol + ") FROM " + sessionTable + " WHERE " + sessionAppCol + " = ?";
 
         int numberOfTries = 2;
         while (numberOfTries > 0) {
@@ -421,7 +398,7 @@ public class DataSourceStore extends StoreBase {
                 return size;
             }
 
-            try (PreparedStatement preparedSizeSql = _conn.prepareStatement(sizeSql)){
+            try (PreparedStatement preparedSizeSql = _conn.prepareStatement(sizeSql)) {
                 preparedSizeSql.setString(1, getName());
                 try (ResultSet rst = preparedSizeSql.executeQuery()) {
                     if (rst.next()) {
@@ -441,13 +418,15 @@ public class DataSourceStore extends StoreBase {
     }
 
     /**
-     * Load the Session associated with the id <code>id</code>.
-     * If no such session is found <code>null</code> is returned.
+     * Load the Session associated with the id <code>id</code>. If no such session is found <code>null</code> is
+     * returned.
      *
      * @param id a value of type <code>String</code>
+     *
      * @return the stored <code>Session</code>
+     *
      * @exception ClassNotFoundException if an error occurs
-     * @exception IOException if an input/output error occurred
+     * @exception IOException            if an input/output error occurred
      */
     @Override
     public Session load(String id) throws ClassNotFoundException, IOException {
@@ -456,10 +435,8 @@ public class DataSourceStore extends StoreBase {
         Log contextLog = context.getLogger();
 
         int numberOfTries = 2;
-        String loadSql = "SELECT " + sessionIdCol + ", "
-                + sessionDataCol + " FROM " + sessionTable
-                + " WHERE " + sessionIdCol + " = ? AND "
-                + sessionAppCol + " = ?";
+        String loadSql = "SELECT " + sessionIdCol + ", " + sessionDataCol + " FROM " + sessionTable + " WHERE " +
+                sessionIdCol + " = ? AND " + sessionAppCol + " = ?";
         while (numberOfTries > 0) {
             Connection _conn = getConnection();
             if (_conn == null) {
@@ -468,16 +445,14 @@ public class DataSourceStore extends StoreBase {
 
             ClassLoader oldThreadContextCL = context.bind(Globals.IS_SECURITY_ENABLED, null);
 
-            try (PreparedStatement preparedLoadSql = _conn.prepareStatement(loadSql)){
+            try (PreparedStatement preparedLoadSql = _conn.prepareStatement(loadSql)) {
                 preparedLoadSql.setString(1, id);
                 preparedLoadSql.setString(2, getName());
                 try (ResultSet rst = preparedLoadSql.executeQuery()) {
                     if (rst.next()) {
-                        try (ObjectInputStream ois =
-                                getObjectInputStream(rst.getBinaryStream(2))) {
+                        try (ObjectInputStream ois = getObjectInputStream(rst.getBinaryStream(2))) {
                             if (contextLog.isDebugEnabled()) {
-                                contextLog.debug(sm.getString(
-                                        getStoreName() + ".loading", id, sessionTable));
+                                contextLog.debug(sm.getString(getStoreName() + ".loading", id, sessionTable));
                             }
 
                             _session = (StandardSession) manager.createEmptySession();
@@ -502,9 +477,8 @@ public class DataSourceStore extends StoreBase {
     }
 
     /**
-     * Remove the Session with the specified session identifier from
-     * this Store, if present.  If no such Session is present, this method
-     * takes no action.
+     * Remove the Session with the specified session identifier from this Store, if present. If no such Session is
+     * present, this method takes no action.
      *
      * @param id Session identifier of the Session to be removed
      *
@@ -539,18 +513,17 @@ public class DataSourceStore extends StoreBase {
     }
 
     /**
-     * Remove the Session with the specified session identifier from
-     * this Store, if present.  If no such Session is present, this method
-     * takes no action.
+     * Remove the Session with the specified session identifier from this Store, if present. If no such Session is
+     * present, this method takes no action.
      *
-     * @param id Session identifier of the Session to be removed
+     * @param id    Session identifier of the Session to be removed
      * @param _conn open connection to be used
+     *
      * @throws SQLException if an error occurs while talking to the database
      */
     private void remove(String id, Connection _conn) throws SQLException {
-        String removeSql = "DELETE FROM " + sessionTable
-                + " WHERE " + sessionIdCol + " = ?  AND "
-                + sessionAppCol + " = ?";
+        String removeSql =
+                "DELETE FROM " + sessionTable + " WHERE " + sessionIdCol + " = ?  AND " + sessionAppCol + " = ?";
         try (PreparedStatement preparedRemoveSql = _conn.prepareStatement(removeSql)) {
             preparedRemoveSql.setString(1, id);
             preparedRemoveSql.setString(2, getName());
@@ -565,8 +538,7 @@ public class DataSourceStore extends StoreBase {
      */
     @Override
     public void clear() throws IOException {
-        String clearSql = "DELETE FROM " + sessionTable
-                + " WHERE " + sessionAppCol + " = ?";
+        String clearSql = "DELETE FROM " + sessionTable + " WHERE " + sessionAppCol + " = ?";
 
         int numberOfTries = 2;
         while (numberOfTries > 0) {
@@ -575,7 +547,7 @@ public class DataSourceStore extends StoreBase {
                 return;
             }
 
-            try (PreparedStatement preparedClearSql = _conn.prepareStatement(clearSql)){
+            try (PreparedStatement preparedClearSql = _conn.prepareStatement(clearSql)) {
                 preparedClearSql.setString(1, getName());
                 preparedClearSql.execute();
                 // Break out after the finally block
@@ -593,17 +565,15 @@ public class DataSourceStore extends StoreBase {
      * Save a session to the Store.
      *
      * @param session the session to be stored
+     *
      * @exception IOException if an input/output error occurs
      */
     @Override
     public void save(Session session) throws IOException {
         ByteArrayOutputStream bos = null;
-        String saveSql = "INSERT INTO " + sessionTable + " ("
-                + sessionIdCol + ", " + sessionAppCol + ", "
-                + sessionDataCol + ", " + sessionValidCol
-                + ", " + sessionMaxInactiveCol + ", "
-                + sessionLastAccessedCol
-                + ") VALUES (?, ?, ?, ?, ?, ?)";
+        String saveSql = "INSERT INTO " + sessionTable + " (" + sessionIdCol + ", " + sessionAppCol + ", " +
+                sessionDataCol + ", " + sessionValidCol + ", " + sessionMaxInactiveCol + ", " + sessionLastAccessedCol +
+                ") VALUES (?, ?, ?, ?, ?, ?)";
 
         synchronized (session) {
             int numberOfTries = 2;
@@ -620,8 +590,7 @@ public class DataSourceStore extends StoreBase {
                     remove(session.getIdInternal(), _conn);
 
                     bos = new ByteArrayOutputStream();
-                    try (ObjectOutputStream oos =
-                            new ObjectOutputStream(new BufferedOutputStream(bos))) {
+                    try (ObjectOutputStream oos = new ObjectOutputStream(new BufferedOutputStream(bos))) {
                         ((StandardSession) session).writeObjectData(oos);
                     }
                     byte[] obs = bos.toByteArray();
@@ -651,8 +620,8 @@ public class DataSourceStore extends StoreBase {
         }
 
         if (manager.getContext().getLogger().isDebugEnabled()) {
-            manager.getContext().getLogger().debug(sm.getString(getStoreName() + ".saving",
-                    session.getIdInternal(), sessionTable));
+            manager.getContext().getLogger()
+                    .debug(sm.getString(getStoreName() + ".saving", session.getIdInternal(), sessionTable));
         }
     }
 
@@ -660,9 +629,8 @@ public class DataSourceStore extends StoreBase {
     // --------------------------------------------------------- Protected Methods
 
     /**
-     * Check the connection associated with this store, if it's
-     * <code>null</code> or closed try to reopen it.
-     * Returns <code>null</code> if the connection could not be established.
+     * Check the connection associated with this store, if it's <code>null</code> or closed try to reopen it. Returns
+     * <code>null</code> if the connection could not be established.
      *
      * @return <code>Connection</code> if the connection succeeded
      */
@@ -674,20 +642,20 @@ public class DataSourceStore extends StoreBase {
                 manager.getContext().getLogger().info(sm.getString(getStoreName() + ".checkConnectionDBClosed"));
                 conn = open();
                 if (conn == null || conn.isClosed()) {
-                    manager.getContext().getLogger().info(sm.getString(getStoreName() + ".checkConnectionDBReOpenFail"));
+                    manager.getContext().getLogger()
+                            .info(sm.getString(getStoreName() + ".checkConnectionDBReOpenFail"));
                 }
             }
         } catch (SQLException ex) {
-            manager.getContext().getLogger().error(sm.getString(getStoreName() + ".checkConnectionSQLException",
-                    ex.toString()));
+            manager.getContext().getLogger()
+                    .error(sm.getString(getStoreName() + ".checkConnectionSQLException", ex.toString()));
         }
 
         return conn;
     }
 
     /**
-     * Open (if necessary) and return a database connection for use by
-     * this Store.
+     * Open (if necessary) and return a database connection for use by this Store.
      *
      * @return database connection ready to use
      *
@@ -707,9 +675,7 @@ public class DataSourceStore extends StoreBase {
                 Context envCtx = (Context) initCtx.lookup("java:comp/env");
                 this.dataSource = (DataSource) envCtx.lookup(this.dataSourceName);
             } catch (NamingException e) {
-                context.getLogger().error(
-                        sm.getString(getStoreName() + ".wrongDataSource",
-                                this.dataSourceName), e);
+                context.getLogger().error(sm.getString(getStoreName() + ".wrongDataSource", this.dataSourceName), e);
             } finally {
                 if (localDataSource) {
                     context.unbind(Globals.IS_SECURITY_ENABLED, oldThreadContextCL);
@@ -749,13 +715,13 @@ public class DataSourceStore extends StoreBase {
         try {
             dbConnection.close();
         } catch (SQLException e) {
-            manager.getContext().getLogger().error(sm.getString(getStoreName() + ".close", e.toString())); // Just log it here
+            manager.getContext().getLogger().error(sm.getString(getStoreName() + ".close", e.toString())); // Just log
+                                                                                                           // it here
         }
     }
 
     /**
-     * Release the connection, if it
-     * is associated with a connection pool.
+     * Release the connection, if it is associated with a connection pool.
      *
      * @param conn The connection to be released
      */
diff --git a/java/org/apache/catalina/session/FileStore.java b/java/org/apache/catalina/session/FileStore.java
index 1aba87e719..1de64e869f 100644
--- a/java/org/apache/catalina/session/FileStore.java
+++ b/java/org/apache/catalina/session/FileStore.java
@@ -37,9 +37,8 @@ import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.res.StringManager;
 
 /**
- * Concrete implementation of the <b>Store</b> interface that utilizes
- * a file per saved Session in a configured directory.  Sessions that are
- * saved are still subject to being expired based on inactivity.
+ * Concrete implementation of the <b>Store</b> interface that utilizes a file per saved Session in a configured
+ * directory. Sessions that are saved are still subject to being expired based on inactivity.
  *
  * @author Craig R. McClanahan
  */
@@ -60,9 +59,8 @@ public final class FileStore extends StoreBase {
     // ----------------------------------------------------- Instance Variables
 
     /**
-     * The pathname of the directory in which Sessions are stored.
-     * This may be an absolute pathname, or a relative path that is
-     * resolved against the temporary work directory for this application.
+     * The pathname of the directory in which Sessions are stored. This may be an absolute pathname, or a relative path
+     * that is resolved against the temporary work directory for this application.
      */
     private String directory = ".";
 
@@ -169,9 +167,8 @@ public final class FileStore extends StoreBase {
 
 
     /**
-     * Return an array containing the session identifiers of all Sessions
-     * currently saved in this Store.  If there are no such Sessions, a
-     * zero-length array is returned.
+     * Return an array containing the session identifiers of all Sessions currently saved in this Store. If there are no
+     * such Sessions, a zero-length array is returned.
      *
      * @exception IOException if an input/output error occurred
      */
@@ -194,7 +191,7 @@ public final class FileStore extends StoreBase {
         int n = FILE_EXT.length();
         for (String file : files) {
             if (file.endsWith(FILE_EXT)) {
-                list.add (file.substring(0, file.length() - n));
+                list.add(file.substring(0, file.length() - n));
             }
         }
         return list.toArray(new String[0]);
@@ -202,14 +199,13 @@ public final class FileStore extends StoreBase {
 
 
     /**
-     * Load and return the Session associated with the specified session
-     * identifier from this Store, without removing it.  If there is no
-     * such stored Session, return <code>null</code>.
+     * Load and return the Session associated with the specified session identifier from this Store, without removing
+     * it. If there is no such stored Session, return <code>null</code>.
      *
      * @param id Session identifier of the session to load
      *
      * @exception ClassNotFoundException if a deserialization error occurs
-     * @exception IOException if an input/output error occurs
+     * @exception IOException            if an input/output error occurs
      */
     @Override
     public Session load(String id) throws ClassNotFoundException, IOException {
@@ -223,7 +219,7 @@ public final class FileStore extends StoreBase {
         Log contextLog = context.getLogger();
 
         if (contextLog.isDebugEnabled()) {
-            contextLog.debug(sm.getString(getStoreName()+".loading", id, file.getAbsolutePath()));
+            contextLog.debug(sm.getString(getStoreName() + ".loading", id, file.getAbsolutePath()));
         }
 
         ClassLoader oldThreadContextCL = context.bind(Globals.IS_SECURITY_ENABLED, null);
@@ -247,9 +243,8 @@ public final class FileStore extends StoreBase {
 
 
     /**
-     * Remove the Session with the specified session identifier from
-     * this Store, if present.  If no such Session is present, this method
-     * takes no action.
+     * Remove the Session with the specified session identifier from this Store, if present. If no such Session is
+     * present, this method takes no action.
      *
      * @param id Session identifier of the Session to be removed
      *
@@ -262,8 +257,8 @@ public final class FileStore extends StoreBase {
             return;
         }
         if (manager.getContext().getLogger().isDebugEnabled()) {
-            manager.getContext().getLogger().debug(sm.getString(getStoreName() + ".removing",
-                             id, file.getAbsolutePath()));
+            manager.getContext().getLogger()
+                    .debug(sm.getString(getStoreName() + ".removing", id, file.getAbsolutePath()));
         }
 
         if (file.exists() && !file.delete()) {
@@ -273,8 +268,8 @@ public final class FileStore extends StoreBase {
 
 
     /**
-     * Save the specified Session into this Store.  Any previously saved
-     * information for the associated session identifier is replaced.
+     * Save the specified Session into this Store. Any previously saved information for the associated session
+     * identifier is replaced.
      *
      * @param session Session to be saved
      *
@@ -288,13 +283,13 @@ public final class FileStore extends StoreBase {
             return;
         }
         if (manager.getContext().getLogger().isDebugEnabled()) {
-            manager.getContext().getLogger().debug(sm.getString(getStoreName() + ".saving",
-                             session.getIdInternal(), file.getAbsolutePath()));
+            manager.getContext().getLogger()
+                    .debug(sm.getString(getStoreName() + ".saving", session.getIdInternal(), file.getAbsolutePath()));
         }
 
         try (FileOutputStream fos = new FileOutputStream(file.getAbsolutePath());
                 ObjectOutputStream oos = new ObjectOutputStream(new BufferedOutputStream(fos))) {
-            ((StandardSession)session).writeObjectData(oos);
+            ((StandardSession) session).writeObjectData(oos);
         }
     }
 
@@ -302,16 +297,15 @@ public final class FileStore extends StoreBase {
     // -------------------------------------------------------- Private Methods
 
     /**
-     * Return a File object representing the pathname to our
-     * session persistence directory, if any.  The directory will be
-     * created if it does not already exist.
+     * Return a File object representing the pathname to our session persistence directory, if any. The directory will
+     * be created if it does not already exist.
      */
     private File directory() throws IOException {
         if (this.directory == null) {
             return null;
         }
         if (this.directoryFile != null) {
-            // NOTE:  Race condition is harmless, so do not synchronize
+            // NOTE: Race condition is harmless, so do not synchronize
             return this.directoryFile;
         }
         File file = new File(this.directory);
@@ -335,11 +329,9 @@ public final class FileStore extends StoreBase {
 
 
     /**
-     * Return a File object representing the pathname to our
-     * session persistence file, if any.
+     * Return a File object representing the pathname to our session persistence file, if any.
      *
-     * @param id The ID of the Session to be retrieved. This is
-     *    used in the file naming.
+     * @param id The ID of the Session to be retrieved. This is used in the file naming.
      */
     private File file(String id) throws IOException {
         File storageDir = directory();
diff --git a/java/org/apache/catalina/session/ManagerBase.java b/java/org/apache/catalina/session/ManagerBase.java
index c78b1ae4c2..de253e0933 100644
--- a/java/org/apache/catalina/session/ManagerBase.java
+++ b/java/org/apache/catalina/session/ManagerBase.java
@@ -53,9 +53,8 @@ import org.apache.tomcat.util.res.StringManager;
 
 
 /**
- * Minimal implementation of the <b>Manager</b> interface that supports
- * no session persistence or distributable capabilities.  This class may
- * be subclassed to create more sophisticated Manager implementations.
+ * Minimal implementation of the <b>Manager</b> interface that supports no session persistence or distributable
+ * capabilities. This class may be subclassed to create more sophisticated Manager implementations.
  *
  * @author Craig R. McClanahan
  */
@@ -78,33 +77,26 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
 
     /**
-     * The Java class name of the secure random number generator class to be
-     * used when generating session identifiers. The random number generator
-     * class must be self-seeding and have a zero-argument constructor. If not
-     * specified, an instance of {@link java.security.SecureRandom} will be
-     * generated.
+     * The Java class name of the secure random number generator class to be used when generating session identifiers.
+     * The random number generator class must be self-seeding and have a zero-argument constructor. If not specified, an
+     * instance of {@link java.security.SecureRandom} will be generated.
      */
     protected String secureRandomClass = null;
 
     /**
-     * The name of the algorithm to use to create instances of
-     * {@link java.security.SecureRandom} which are used to generate session
-     * IDs. If no algorithm is specified, SHA1PRNG is used. If SHA1PRNG is not
-     * available, the platform default will be used. To use the platform default
-     * (which may be SHA1PRNG), specify the empty string. If an invalid
-     * algorithm and/or provider is specified the SecureRandom instances will be
-     * created using the defaults. If that fails, the SecureRandom instances
-     * will be created using platform defaults.
+     * The name of the algorithm to use to create instances of {@link java.security.SecureRandom} which are used to
+     * generate session IDs. If no algorithm is specified, SHA1PRNG is used. If SHA1PRNG is not available, the platform
+     * default will be used. To use the platform default (which may be SHA1PRNG), specify the empty string. If an
+     * invalid algorithm and/or provider is specified the SecureRandom instances will be created using the defaults. If
+     * that fails, the SecureRandom instances will be created using platform defaults.
      */
     protected String secureRandomAlgorithm = SessionIdGeneratorBase.DEFAULT_SECURE_RANDOM_ALGORITHM;
 
     /**
-     * The name of the provider to use to create instances of
-     * {@link java.security.SecureRandom} which are used to generate session
-     * IDs. If no provider is specified the platform default is used. If an
-     * invalid algorithm and/or provider is specified the SecureRandom instances
-     * will be created using the defaults. If that fails, the SecureRandom
-     * instances will be created using platform defaults.
+     * The name of the provider to use to create instances of {@link java.security.SecureRandom} which are used to
+     * generate session IDs. If no provider is specified the platform default is used. If an invalid algorithm and/or
+     * provider is specified the SecureRandom instances will be created using the defaults. If that fails, the
+     * SecureRandom instances will be created using platform defaults.
      */
     protected String secureRandomProvider = null;
 
@@ -131,15 +123,14 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
 
     /**
-     * The set of currently active Sessions for this Manager, keyed by
-     * session identifier.
+     * The set of currently active Sessions for this Manager, keyed by session identifier.
      */
-    protected Map<String, Session> sessions = new ConcurrentHashMap<>();
+    protected Map<String,Session> sessions = new ConcurrentHashMap<>();
 
     // Number of sessions created by this manager
-    protected long sessionCounter=0;
+    protected long sessionCounter = 0;
 
-    protected volatile int maxActive=0;
+    protected volatile int maxActive = 0;
 
     private final Object maxActiveUpdateLock = new Object();
 
@@ -154,7 +145,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
     protected int rejectedSessions = 0;
 
     // number of duplicated session ids - anything >0 means we have problems
-    protected volatile int duplicates=0;
+    protected volatile int duplicates = 0;
 
     /**
      * Processing time during session expiration.
@@ -168,10 +159,8 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
 
     /**
-     * Frequency of the session expiration, and related manager operations.
-     * Manager operations will be done once for the specified amount of
-     * backgroundProcess calls (ie, the lower the amount, the most often the
-     * checks will occur).
+     * Frequency of the session expiration, and related manager operations. Manager operations will be done once for the
+     * specified amount of backgroundProcess calls (ie, the lower the amount, the most often the checks will occur).
      */
     protected int processExpiresFrequency = 6;
 
@@ -183,8 +172,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
     /**
      * The property change support for this component.
      */
-    protected final PropertyChangeSupport support =
-            new PropertyChangeSupport(this);
+    protected final PropertyChangeSupport support = new PropertyChangeSupport(this);
 
     private Pattern sessionAttributeNamePattern;
 
@@ -197,8 +185,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
     private boolean notifyAttributeListenerOnUnchangedValue = true;
 
     /**
-     * Determines whether sessions managed by this manager shall persist (serialize)
-     * authentication information or not.
+     * Determines whether sessions managed by this manager shall persist (serialize) authentication information or not.
      */
     private boolean persistAuthentication = false;
 
@@ -213,10 +200,9 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
             // Minimum set required for default distribution/persistence to work
             // plus String
             // plus SerializablePrincipal and String[] (required for authentication persistence)
-            setSessionAttributeValueClassNameFilter(
-                    "java\\.lang\\.(?:Boolean|Integer|Long|Number|String)"
-                    + "|org\\.apache\\.catalina\\.realm\\.GenericPrincipal\\$SerializablePrincipal"
-                    + "|\\[Ljava.lang.String;");
+            setSessionAttributeValueClassNameFilter("java\\.lang\\.(?:Boolean|Integer|Long|Number|String)" +
+                    "|org\\.apache\\.catalina\\.realm\\.GenericPrincipal\\$SerializablePrincipal" +
+                    "|\\[Ljava.lang.String;");
             setWarnOnSessionAttributeFilterFailure(true);
         }
     }
@@ -230,7 +216,6 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
     }
 
 
-
     @Override
     public void setNotifyAttributeListenerOnUnchangedValue(boolean notifyAttributeListenerOnUnchangedValue) {
         this.notifyAttributeListenerOnUnchangedValue = notifyAttributeListenerOnUnchangedValue;
@@ -274,14 +259,12 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
 
     /**
-     * Obtain the regular expression used to filter session attribute based on
-     * attribute name. The regular expression is anchored so it must match the
-     * entire name
+     * Obtain the regular expression used to filter session attribute based on attribute name. The regular expression is
+     * anchored so it must match the entire name
      *
-     * @return The regular expression currently used to filter attribute names.
-     *         {@code null} means no filter is applied. If an empty string is
-     *         specified then no names will match the filter and all attributes
-     *         will be blocked.
+     * @return The regular expression currently used to filter attribute names. {@code null} means no filter is applied.
+     *             If an empty string is specified then no names will match the filter and all attributes will be
+     *             blocked.
      */
     public String getSessionAttributeNameFilter() {
         if (sessionAttributeNamePattern == null) {
@@ -292,19 +275,17 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
 
     /**
-     * Set the regular expression to use to filter session attributes based on
-     * attribute name. The regular expression is anchored so it must match the
-     * entire name.
+     * Set the regular expression to use to filter session attributes based on attribute name. The regular expression is
+     * anchored so it must match the entire name.
      *
-     * @param sessionAttributeNameFilter The regular expression to use to filter
-     *        session attributes based on attribute name. Use {@code null} if no
-     *        filtering is required. If an empty string is specified then no
-     *        names will match the filter and all attributes will be blocked.
+     * @param sessionAttributeNameFilter The regular expression to use to filter session attributes based on attribute
+     *                                       name. Use {@code null} if no filtering is required. If an empty string is
+     *                                       specified then no names will match the filter and all attributes will be
+     *                                       blocked.
      *
      * @throws PatternSyntaxException If the expression is not valid
      */
-    public void setSessionAttributeNameFilter(String sessionAttributeNameFilter)
-            throws PatternSyntaxException {
+    public void setSessionAttributeNameFilter(String sessionAttributeNameFilter) throws PatternSyntaxException {
         if (sessionAttributeNameFilter == null || sessionAttributeNameFilter.length() == 0) {
             sessionAttributeNamePattern = null;
         } else {
@@ -314,11 +295,10 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
 
     /**
-     * Provides {@link #getSessionAttributeNameFilter()} as a pre-compiled
-     * regular expression pattern.
+     * Provides {@link #getSessionAttributeNameFilter()} as a pre-compiled regular expression pattern.
      *
-     * @return The pre-compiled pattern used to filter session attributes based
-     *         on attribute name. {@code null} means no filter is applied.
+     * @return The pre-compiled pattern used to filter session attributes based on attribute name. {@code null} means no
+     *             filter is applied.
      */
     protected Pattern getSessionAttributeNamePattern() {
         return sessionAttributeNamePattern;
@@ -326,14 +306,11 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
 
     /**
-     * Obtain the regular expression used to filter session attribute based on
-     * the implementation class of the value. The regular expression is anchored
-     * and must match the fully qualified class name.
+     * Obtain the regular expression used to filter session attribute based on the implementation class of the value.
+     * The regular expression is anchored and must match the fully qualified class name.
      *
-     * @return The regular expression currently used to filter class names.
-     *         {@code null} means no filter is applied. If an empty string is
-     *         specified then no names will match the filter and all attributes
-     *         will be blocked.
+     * @return The regular expression currently used to filter class names. {@code null} means no filter is applied. If
+     *             an empty string is specified then no names will match the filter and all attributes will be blocked.
      */
     public String getSessionAttributeValueClassNameFilter() {
         if (sessionAttributeValueClassNamePattern == null) {
@@ -344,12 +321,10 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
 
     /**
-     * Provides {@link #getSessionAttributeValueClassNameFilter()} as a
-     * pre-compiled regular expression pattern.
+     * Provides {@link #getSessionAttributeValueClassNameFilter()} as a pre-compiled regular expression pattern.
      *
-     * @return The pre-compiled pattern used to filter session attributes based
-     *         on the implementation class name of the value. {@code null} means
-     *         no filter is applied.
+     * @return The pre-compiled pattern used to filter session attributes based on the implementation class name of the
+     *             value. {@code null} means no filter is applied.
      */
     protected Pattern getSessionAttributeValueClassNamePattern() {
         return sessionAttributeValueClassNamePattern;
@@ -357,33 +332,28 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
 
     /**
-     * Set the regular expression to use to filter classes used for session
-     * attributes. The regular expression is anchored and must match the fully
-     * qualified class name.
+     * Set the regular expression to use to filter classes used for session attributes. The regular expression is
+     * anchored and must match the fully qualified class name.
      *
-     * @param sessionAttributeValueClassNameFilter The regular expression to use
-     *            to filter session attributes based on class name. Use {@code
-     *            null} if no filtering is required. If an empty string is
-     *           specified then no names will match the filter and all
-     *           attributes will be blocked.
+     * @param sessionAttributeValueClassNameFilter The regular expression to use to filter session attributes based on
+     *                                                 class name. Use {@code
+     *            null}                         if no filtering is required. If an empty string is specified then no
+     *                                                 names will match the filter and all attributes will be blocked.
      *
      * @throws PatternSyntaxException If the expression is not valid
      */
     public void setSessionAttributeValueClassNameFilter(String sessionAttributeValueClassNameFilter)
             throws PatternSyntaxException {
-        if (sessionAttributeValueClassNameFilter == null ||
-                sessionAttributeValueClassNameFilter.length() == 0) {
+        if (sessionAttributeValueClassNameFilter == null || sessionAttributeValueClassNameFilter.length() == 0) {
             sessionAttributeValueClassNamePattern = null;
         } else {
-            sessionAttributeValueClassNamePattern =
-                    Pattern.compile(sessionAttributeValueClassNameFilter);
+            sessionAttributeValueClassNamePattern = Pattern.compile(sessionAttributeValueClassNameFilter);
         }
     }
 
 
     /**
-     * Should a warn level log message be generated if a session attribute is
-     * not persisted / replicated / restored.
+     * Should a warn level log message be generated if a session attribute is not persisted / replicated / restored.
      *
      * @return {@code true} if a warn level log message should be generated
      */
@@ -393,15 +363,12 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
 
     /**
-     * Configure whether or not a warn level log message should be generated if
-     * a session attribute is not persisted / replicated / restored.
-     *
-     * @param warnOnSessionAttributeFilterFailure {@code true} if the
-     *            warn level message should be generated
+     * Configure whether or not a warn level log message should be generated if a session attribute is not persisted /
+     * replicated / restored.
      *
+     * @param warnOnSessionAttributeFilterFailure {@code true} if the warn level message should be generated
      */
-    public void setWarnOnSessionAttributeFilterFailure(
-            boolean warnOnSessionAttributeFilterFailure) {
+    public void setWarnOnSessionAttributeFilterFailure(boolean warnOnSessionAttributeFilterFailure) {
         this.warnOnSessionAttributeFilterFailure = warnOnSessionAttributeFilterFailure;
     }
 
@@ -443,7 +410,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
             try {
                 sessionIdGenerator = sessionIdGeneratorClass.getConstructor().newInstance();
                 return sessionIdGenerator;
-            } catch(ReflectiveOperationException ex) {
+            } catch (ReflectiveOperationException ex) {
                 // Ignore
             }
         }
@@ -476,15 +443,13 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
     /**
      * Set the secure random number generator class name.
      *
-     * @param secureRandomClass The new secure random number generator class
-     *                          name
+     * @param secureRandomClass The new secure random number generator class name
      */
     public void setSecureRandomClass(String secureRandomClass) {
 
         String oldSecureRandomClass = this.secureRandomClass;
         this.secureRandomClass = secureRandomClass;
-        support.firePropertyChange("secureRandomClass", oldSecureRandomClass,
-                                   this.secureRandomClass);
+        support.firePropertyChange("secureRandomClass", oldSecureRandomClass, this.secureRandomClass);
 
     }
 
@@ -500,8 +465,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
     /**
      * Set the secure random number generator algorithm name.
      *
-     * @param secureRandomAlgorithm The new secure random number generator
-     *                              algorithm name
+     * @param secureRandomAlgorithm The new secure random number generator algorithm name
      */
     public void setSecureRandomAlgorithm(String secureRandomAlgorithm) {
         this.secureRandomAlgorithm = secureRandomAlgorithm;
@@ -519,8 +483,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
     /**
      * Set the secure random number generator provider name.
      *
-     * @param secureRandomProvider The new secure random number generator
-     *                             provider name
+     * @param secureRandomProvider The new secure random number generator provider name
      */
     public void setSecureRandomProvider(String secureRandomProvider) {
         this.secureRandomProvider = secureRandomProvider;
@@ -573,30 +536,27 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
         int oldProcessExpiresFrequency = this.processExpiresFrequency;
         this.processExpiresFrequency = processExpiresFrequency;
-        support.firePropertyChange("processExpiresFrequency",
-                                   Integer.valueOf(oldProcessExpiresFrequency),
-                                   Integer.valueOf(this.processExpiresFrequency));
+        support.firePropertyChange("processExpiresFrequency", Integer.valueOf(oldProcessExpiresFrequency),
+                Integer.valueOf(this.processExpiresFrequency));
 
     }
 
 
     /**
-     * Return whether sessions managed by this manager shall persist authentication
-     * information or not.
+     * Return whether sessions managed by this manager shall persist authentication information or not.
      *
-     * @return {@code true}, sessions managed by this manager shall persist
-     *         authentication information; {@code false} otherwise
+     * @return {@code true}, sessions managed by this manager shall persist authentication information; {@code false}
+     *             otherwise
      */
     public boolean getPersistAuthentication() {
         return this.persistAuthentication;
     }
 
     /**
-     * Set whether sessions managed by this manager shall persist authentication
-     * information or not.
+     * Set whether sessions managed by this manager shall persist authentication information or not.
      *
-     * @param persistAuthentication if {@code true}, sessions managed by this manager
-     *                              shall persist authentication information
+     * @param persistAuthentication if {@code true}, sessions managed by this manager shall persist authentication
+     *                                  information
      */
     public void setPersistAuthentication(boolean persistAuthentication) {
         this.persistAuthentication = persistAuthentication;
@@ -625,9 +585,9 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
         long timeNow = System.currentTimeMillis();
         Session sessions[] = findSessions();
-        int expireHere = 0 ;
+        int expireHere = 0;
 
-        if(log.isDebugEnabled()) {
+        if (log.isDebugEnabled()) {
             log.debug("Start expire sessions " + getName() + " at " + timeNow + " sessioncount " + sessions.length);
         }
         for (Session session : sessions) {
@@ -636,10 +596,11 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
             }
         }
         long timeEnd = System.currentTimeMillis();
-        if(log.isDebugEnabled()) {
-            log.debug("End expire sessions " + getName() + " processingTime " + (timeEnd - timeNow) + " expired sessions: " + expireHere);
+        if (log.isDebugEnabled()) {
+            log.debug("End expire sessions " + getName() + " processingTime " + (timeEnd - timeNow) +
+                    " expired sessions: " + expireHere);
         }
-        processingTime += ( timeEnd - timeNow );
+        processingTime += (timeEnd - timeNow);
 
     }
 
@@ -675,7 +636,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
         sessionIdGenerator.setJvmRoute(getJvmRoute());
         if (sessionIdGenerator instanceof SessionIdGeneratorBase) {
-            SessionIdGeneratorBase sig = (SessionIdGeneratorBase)sessionIdGenerator;
+            SessionIdGeneratorBase sig = (SessionIdGeneratorBase) sessionIdGenerator;
             sig.setSecureRandomAlgorithm(getSecureRandomAlgorithm());
             sig.setSecureRandomClass(getSecureRandomClass());
             sig.setSecureRandomProvider(getSecureRandomProvider());
@@ -708,9 +669,9 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
     public void add(Session session) {
         sessions.put(session.getIdInternal(), session);
         int size = getActiveSessions();
-        if( size > maxActive ) {
-            synchronized(maxActiveUpdateLock) {
-                if( size > maxActive ) {
+        if (size > maxActive) {
+            synchronized (maxActiveUpdateLock) {
+                if (size > maxActive) {
                     maxActive = size;
                 }
             }
@@ -727,12 +688,9 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
     @Override
     public Session createSession(String sessionId) {
 
-        if ((maxActiveSessions >= 0) &&
-                (getActiveSessions() >= maxActiveSessions)) {
+        if ((maxActiveSessions >= 0) && (getActiveSessions() >= maxActiveSessions)) {
             rejectedSessions++;
-            throw new TooManyActiveSessionsException(
-                    sm.getString("managerBase.createSession.ise"),
-                    maxActiveSessions);
+            throw new TooManyActiveSessionsException(sm.getString("managerBase.createSession.ise"), maxActiveSessions);
         }
 
         // Recycle or create a Session instance
@@ -792,8 +750,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
         // the manager because it is being persisted - update the expired stats
         if (update) {
             long timeNow = System.currentTimeMillis();
-            int timeAlive =
-                (int) (timeNow - session.getCreationTimeInternal())/1000;
+            int timeAlive = (int) (timeNow - session.getCreationTimeInternal()) / 1000;
             updateSessionMaxAliveTime(timeAlive);
             expiredSessions.incrementAndGet();
             SessionTiming timing = new SessionTiming(timeNow, timeAlive);
@@ -829,12 +786,11 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
     }
 
 
-    protected void changeSessionId(Session session, String newId,
-            boolean notifySessionListeners, boolean notifyContainerListeners) {
+    protected void changeSessionId(Session session, String newId, boolean notifySessionListeners,
+            boolean notifyContainerListeners) {
         String oldId = session.getIdInternal();
         session.setId(newId, false);
-        session.tellChangedSessionId(newId, oldId,
-                notifySessionListeners, notifyContainerListeners);
+        session.tellChangedSessionId(newId, oldId, notifySessionListeners, notifyContainerListeners);
     }
 
 
@@ -852,8 +808,8 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
         if (sessionAttributeNamePattern != null) {
             if (!sessionAttributeNamePattern.matcher(name).matches()) {
                 if (getWarnOnSessionAttributeFilterFailure() || log.isDebugEnabled()) {
-                    String msg = sm.getString("managerBase.sessionAttributeNameFilter",
-                            name, sessionAttributeNamePattern);
+                    String msg =
+                            sm.getString("managerBase.sessionAttributeNameFilter", name, sessionAttributeNamePattern);
                     if (getWarnOnSessionAttributeFilterFailure()) {
                         log.warn(msg);
                     } else {
@@ -866,11 +822,10 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
         Pattern sessionAttributeValueClassNamePattern = getSessionAttributeValueClassNamePattern();
         if (value != null && sessionAttributeValueClassNamePattern != null) {
-            if (!sessionAttributeValueClassNamePattern.matcher(
-                    value.getClass().getName()).matches()) {
+            if (!sessionAttributeValueClassNamePattern.matcher(value.getClass().getName()).matches()) {
                 if (getWarnOnSessionAttributeFilterFailure() || log.isDebugEnabled()) {
-                    String msg = sm.getString("managerBase.sessionAttributeValueClassNameFilter",
-                            name, value.getClass().getName(), sessionAttributeValueClassNamePattern);
+                    String msg = sm.getString("managerBase.sessionAttributeValueClassNameFilter", name,
+                            value.getClass().getName(), sessionAttributeValueClassNamePattern);
                     if (getWarnOnSessionAttributeFilterFailure()) {
                         log.warn(msg);
                     } else {
@@ -890,6 +845,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
     /**
      * Get new session class to be used in the doLoad() method.
+     *
      * @return a new session for use with this manager
      */
     protected StandardSession getNewSession() {
@@ -899,6 +855,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
     /**
      * Generate and return a new session identifier.
+     *
      * @return a new session id
      */
     protected String generateSessionId() {
@@ -931,9 +888,9 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
      */
     public Engine getEngine() {
         Engine e = null;
-        for (Container c = getContext(); e == null && c != null ; c = c.getParent()) {
+        for (Container c = getContext(); e == null && c != null; c = c.getParent()) {
             if (c instanceof Engine) {
-                e = (Engine)c;
+                e = (Engine) c;
             }
         }
         return e;
@@ -942,6 +899,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
     /**
      * Retrieve the JvmRoute for the enclosing Engine.
+     *
      * @return the JvmRoute or null.
      */
     public String getJvmRoute() {
@@ -966,8 +924,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
 
     /**
-     * Number of duplicated session IDs generated by the random source.
-     * Anything bigger than 0 means problems.
+     * Number of duplicated session IDs generated by the random source. Anything bigger than 0 means problems.
      *
      * @return The count of duplicates
      */
@@ -1002,8 +959,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
 
     /**
-     * @return The maximum number of active Sessions allowed, or -1 for no
-     *         limit.
+     * @return The maximum number of active Sessions allowed, or -1 for no limit.
      */
     public int getMaxActiveSessions() {
         return this.maxActiveSessions;
@@ -1011,8 +967,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
 
     /**
-     * Set the maximum number of active Sessions allowed, or -1 for
-     * no limit.
+     * Set the maximum number of active Sessions allowed, or -1 for no limit.
      *
      * @param max The new maximum number of sessions
      */
@@ -1020,9 +975,8 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
         int oldMaxActiveSessions = this.maxActiveSessions;
         this.maxActiveSessions = max;
-        support.firePropertyChange("maxActiveSessions",
-                                   Integer.valueOf(oldMaxActiveSessions),
-                                   Integer.valueOf(this.maxActiveSessions));
+        support.firePropertyChange("maxActiveSessions", Integer.valueOf(oldMaxActiveSessions),
+                Integer.valueOf(this.maxActiveSessions));
 
     }
 
@@ -1042,11 +996,9 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
 
     /**
-     * Updates the sessionMaxAliveTime attribute if the candidate value is
-     * larger than the current value.
+     * Updates the sessionMaxAliveTime attribute if the candidate value is larger than the current value.
      *
-     * @param sessionAliveTime  The candidate value (in seconds) for the new
-     *                          sessionMaxAliveTime value.
+     * @param sessionAliveTime The candidate value (in seconds) for the new sessionMaxAliveTime value.
      */
     public void updateSessionMaxAliveTime(int sessionAliveTime) {
         if (sessionAliveTime > this.sessionMaxAliveTime) {
@@ -1061,8 +1013,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
     /**
      * {@inheritDoc}
      * <p>
-     * Based on the last 100 sessions to expire. If less than 100 sessions have
-     * expired then all available data is used.
+     * Based on the last 100 sessions to expire. If less than 100 sessions have expired then all available data is used.
      */
     @Override
     public int getSessionAverageAliveTime() {
@@ -1082,8 +1033,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
                 int timeAlive = timing.getDuration();
                 counter++;
                 // Very careful not to overflow - probably not necessary
-                result =
-                    (result * ((counter - 1)/counter)) + (timeAlive/counter);
+                result = (result * ((counter - 1) / counter)) + (timeAlive / counter);
             }
         }
         return result;
@@ -1091,9 +1041,10 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
 
     /**
-     * {@inheritDoc}<p>
-     * Based on the creation time of the previous 100 sessions created. If less
-     * than 100 sessions have been created then all available data is used.
+     * {@inheritDoc}
+     * <p>
+     * Based on the creation time of the previous 100 sessions created. If less than 100 sessions have been created then
+     * all available data is used.
      */
     @Override
     public int getSessionCreateRate() {
@@ -1110,10 +1061,10 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
     /**
      * {@inheritDoc}
      * <p>
-     * Based on the expiry time of the previous 100 sessions expired. If less
-     * than 100 sessions have expired then all available data is used.
+     * Based on the expiry time of the previous 100 sessions expired. If less than 100 sessions have expired then all
+     * available data is used.
      *
-     * @return  The current rate (in sessions per minute) of session expiration
+     * @return The current rate (in sessions per minute) of session expiration
      */
     @Override
     public int getSessionExpireRate() {
@@ -1145,7 +1096,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
         }
         if (counter > 0) {
             if (oldest < now) {
-                result = (1000*60*counter)/(int) (now - oldest);
+                result = (1000 * 60 * counter) / (int) (now - oldest);
             } else {
                 // Better than reporting zero
                 result = Integer.MAX_VALUE;
@@ -1175,10 +1126,9 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
      * @param sessionId The ID for the session of interest
      * @param key       The key for the attribute to obtain
      *
-     * @return The attribute value for the specified session, if found, null
-     *         otherwise
+     * @return The attribute value for the specified session, if found, null otherwise
      */
-    public String getSessionAttribute( String sessionId, String key ) {
+    public String getSessionAttribute(String sessionId, String key) {
         Session s = sessions.get(sessionId);
         if (s == null) {
             if (log.isInfoEnabled()) {
@@ -1186,8 +1136,8 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
             }
             return null;
         }
-        Object o=s.getSession().getAttribute(key);
-        if( o==null ) {
+        Object o = s.getSession().getAttribute(key);
+        if (o == null) {
             return null;
         }
         return o.toString();
@@ -1196,17 +1146,16 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
 
     /**
      * Returns information about the session with the given session id.
-     *
-     * <p>The session information is organized as a HashMap, mapping
-     * session attribute names to the String representation of their values.
+     * <p>
+     * The session information is organized as a HashMap, mapping session attribute names to the String representation
+     * of their values.
      *
      * @param sessionId Session id
      *
-     * @return HashMap mapping session attribute names to the String
-     * representation of their values, or null if no session with the
-     * specified id exists, or if the session does not have any attributes
+     * @return HashMap mapping session attribute names to the String representation of their values, or null if no
+     *             session with the specified id exists, or if the session does not have any attributes
      */
-    public HashMap<String, String> getSession(String sessionId) {
+    public HashMap<String,String> getSession(String sessionId) {
         Session s = sessions.get(sessionId);
         if (s == null) {
             if (log.isInfoEnabled()) {
@@ -1220,7 +1169,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
             return null;
         }
 
-        HashMap<String, String> map = new HashMap<>();
+        HashMap<String,String> map = new HashMap<>();
         while (ee.hasMoreElements()) {
             String attrName = ee.nextElement();
             map.put(attrName, getSessionAttribute(sessionId, attrName));
@@ -1230,7 +1179,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
     }
 
 
-    public void expireSession( String sessionId ) {
+    public void expireSession(String sessionId) {
         Session s = sessions.get(sessionId);
         if (s == null) {
             if (log.isInfoEnabled()) {
@@ -1241,7 +1190,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
         s.expire();
     }
 
-    public long getThisAccessedTimestamp( String sessionId ) {
+    public long getThisAccessedTimestamp(String sessionId) {
         Session s = sessions.get(sessionId);
         if (s == null) {
             if (log.isInfoEnabled()) {
@@ -1252,7 +1201,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
         return s.getThisAccessedTime();
     }
 
-    public String getThisAccessedTime( String sessionId ) {
+    public String getThisAccessedTime(String sessionId) {
         Session s = sessions.get(sessionId);
         if (s == null) {
             if (log.isInfoEnabled()) {
@@ -1263,7 +1212,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
         return new Date(s.getThisAccessedTime()).toString();
     }
 
-    public long getLastAccessedTimestamp( String sessionId ) {
+    public long getLastAccessedTimestamp(String sessionId) {
         Session s = sessions.get(sessionId);
         if (s == null) {
             if (log.isInfoEnabled()) {
@@ -1274,7 +1223,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
         return s.getLastAccessedTime();
     }
 
-    public String getLastAccessedTime( String sessionId ) {
+    public String getLastAccessedTime(String sessionId) {
         Session s = sessions.get(sessionId);
         if (s == null) {
             if (log.isInfoEnabled()) {
@@ -1285,7 +1234,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
         return new Date(s.getLastAccessedTime()).toString();
     }
 
-    public String getCreationTime( String sessionId ) {
+    public String getCreationTime(String sessionId) {
         Session s = sessions.get(sessionId);
         if (s == null) {
             if (log.isInfoEnabled()) {
@@ -1296,7 +1245,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
         return new Date(s.getCreationTime()).toString();
     }
 
-    public long getCreationTimestamp( String sessionId ) {
+    public long getCreationTimestamp(String sessionId) {
         Session s = sessions.get(sessionId);
         if (s == null) {
             if (log.isInfoEnabled()) {
@@ -1314,7 +1263,7 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
     }
 
 
-    // -------------------- JMX and Registration  --------------------
+    // -------------------- JMX and Registration --------------------
     @Override
     public String getObjectNameKeyProperties() {
 
@@ -1351,16 +1300,14 @@ public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
         }
 
         /**
-         * @return Time stamp associated with this piece of timing information
-         *         in milliseconds.
+         * @return Time stamp associated with this piece of timing information in milliseconds.
          */
         public long getTimestamp() {
             return timestamp;
         }
 
         /**
-         * @return Duration associated with this piece of timing information in
-         *         seconds.
+         * @return Duration associated with this piece of timing information in seconds.
          */
         public int getDuration() {
             return duration;
diff --git a/java/org/apache/catalina/session/PersistentManager.java b/java/org/apache/catalina/session/PersistentManager.java
index 09f9a43424..5fd7cd8ea2 100644
--- a/java/org/apache/catalina/session/PersistentManager.java
+++ b/java/org/apache/catalina/session/PersistentManager.java
@@ -17,16 +17,12 @@
 package org.apache.catalina.session;
 
 /**
- * Implementation of the <b>Manager</b> interface that makes use of
- * a Store to swap active Sessions to disk. It can be configured to
- * achieve several different goals:
- *
+ * Implementation of the <b>Manager</b> interface that makes use of a Store to swap active Sessions to disk. It can be
+ * configured to achieve several different goals:
  * <ul>
  * <li>Persist sessions across restarts of the Container</li>
- * <li>Fault tolerance, keep sessions backed up on disk to allow
- *     recovery in the event of unplanned restarts.</li>
- * <li>Limit the number of active sessions kept in memory by
- *     swapping less active sessions out to disk.</li>
+ * <li>Fault tolerance, keep sessions backed up on disk to allow recovery in the event of unplanned restarts.</li>
+ * <li>Limit the number of active sessions kept in memory by swapping less active sessions out to disk.</li>
  * </ul>
  *
  * @author Kief Morris (kief@kief.com)
@@ -47,5 +43,5 @@ public final class PersistentManager extends PersistentManagerBase {
     public String getName() {
         return name;
     }
- }
+}
 
diff --git a/java/org/apache/catalina/session/PersistentManagerBase.java b/java/org/apache/catalina/session/PersistentManagerBase.java
index 2c5b01deb9..0bf00c343f 100644
--- a/java/org/apache/catalina/session/PersistentManagerBase.java
+++ b/java/org/apache/catalina/session/PersistentManagerBase.java
@@ -35,41 +35,36 @@ import org.apache.catalina.StoreManager;
 import org.apache.catalina.security.SecurityUtil;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
+
 /**
- * Extends the {@link ManagerBase} class to implement most of the
- * functionality required by a Manager which supports any kind of
- * persistence, even if only for  restarts.
+ * Extends the {@link ManagerBase} class to implement most of the functionality required by a Manager which supports any
+ * kind of persistence, even if only for restarts.
  * <p>
- * <b>IMPLEMENTATION NOTE</b>:  Correct behavior of session storing and
- * reloading depends upon external calls to the {@link Lifecycle#start()}
- * and {@link Lifecycle#stop()} methods of this class
- * at the correct times.
+ * <b>IMPLEMENTATION NOTE</b>: Correct behavior of session storing and reloading depends upon external calls to the
+ * {@link Lifecycle#start()} and {@link Lifecycle#stop()} methods of this class at the correct times.
  *
  * @author Craig R. McClanahan
  */
-public abstract class PersistentManagerBase extends ManagerBase
-        implements StoreManager {
+public abstract class PersistentManagerBase extends ManagerBase implements StoreManager {
 
     private final Log log = LogFactory.getLog(PersistentManagerBase.class); // must not be static
 
     // ---------------------------------------------------- Security Classes
 
-    private class PrivilegedStoreClear
-        implements PrivilegedExceptionAction<Void> {
+    private class PrivilegedStoreClear implements PrivilegedExceptionAction<Void> {
 
         PrivilegedStoreClear() {
             // NOOP
         }
 
         @Override
-        public Void run() throws Exception{
-           store.clear();
-           return null;
+        public Void run() throws Exception {
+            store.clear();
+            return null;
         }
     }
 
-    private class PrivilegedStoreRemove
-        implements PrivilegedExceptionAction<Void> {
+    private class PrivilegedStoreRemove implements PrivilegedExceptionAction<Void> {
 
         private String id;
 
@@ -78,14 +73,13 @@ public abstract class PersistentManagerBase extends ManagerBase
         }
 
         @Override
-        public Void run() throws Exception{
-           store.remove(id);
-           return null;
+        public Void run() throws Exception {
+            store.remove(id);
+            return null;
         }
     }
 
-    private class PrivilegedStoreLoad
-        implements PrivilegedExceptionAction<Session> {
+    private class PrivilegedStoreLoad implements PrivilegedExceptionAction<Session> {
 
         private String id;
 
@@ -94,13 +88,12 @@ public abstract class PersistentManagerBase extends ManagerBase
         }
 
         @Override
-        public Session run() throws Exception{
-           return store.load(id);
+        public Session run() throws Exception {
+            return store.load(id);
         }
     }
 
-    private class PrivilegedStoreSave
-        implements PrivilegedExceptionAction<Void> {
+    private class PrivilegedStoreSave implements PrivilegedExceptionAction<Void> {
 
         private Session session;
 
@@ -109,22 +102,21 @@ public abstract class PersistentManagerBase extends ManagerBase
         }
 
         @Override
-        public Void run() throws Exception{
-           store.save(session);
-           return null;
+        public Void run() throws Exception {
+            store.save(session);
+            return null;
         }
     }
 
-    private class PrivilegedStoreKeys
-        implements PrivilegedExceptionAction<String[]> {
+    private class PrivilegedStoreKeys implements PrivilegedExceptionAction<String[]> {
 
         PrivilegedStoreKeys() {
             // NOOP
         }
 
         @Override
-        public String[] run() throws Exception{
-           return store.keys();
+        public String[] run() throws Exception {
+            return store.keys();
         }
     }
 
@@ -149,32 +141,29 @@ public abstract class PersistentManagerBase extends ManagerBase
 
 
     /**
-     * Whether to save and reload sessions when the Manager <code>unload</code>
-     * and <code>load</code> methods are called.
+     * Whether to save and reload sessions when the Manager <code>unload</code> and <code>load</code> methods are
+     * called.
      */
     protected boolean saveOnRestart = true;
 
 
     /**
-     * How long a session must be idle before it should be backed up.
-     * {@code -1} means sessions won't be backed up.
+     * How long a session must be idle before it should be backed up. {@code -1} means sessions won't be backed up.
      */
     protected int maxIdleBackup = -1;
 
 
     /**
-     * The minimum time in seconds a session must be idle before it is eligible
-     * to be swapped to disk to keep the active session count below
-     * maxActiveSessions. Setting to {@code -1} means sessions will not be
-     * swapped out to keep the active session count down.
+     * The minimum time in seconds a session must be idle before it is eligible to be swapped to disk to keep the active
+     * session count below maxActiveSessions. Setting to {@code -1} means sessions will not be swapped out to keep the
+     * active session count down.
      */
     protected int minIdleSwap = -1;
 
 
     /**
-     * The maximum time in seconds a session may be idle before it is eligible
-     * to be swapped to disk due to inactivity. Setting this to {@code -1} means
-     * sessions should not be swapped out just because of inactivity.
+     * The maximum time in seconds a session may be idle before it is eligible to be swapped to disk due to inactivity.
+     * Setting this to {@code -1} means sessions should not be swapped out just because of inactivity.
      */
     protected int maxIdleSwap = -1;
 
@@ -185,8 +174,7 @@ public abstract class PersistentManagerBase extends ManagerBase
     private final Map<String,Object> sessionSwapInLocks = new HashMap<>();
 
     /*
-     * Session that is currently getting swapped in to prevent loading it more
-     * than once concurrently
+     * Session that is currently getting swapped in to prevent loading it more than once concurrently
      */
     private final ThreadLocal<Session> sessionToSwapIn = new ThreadLocal<>();
 
@@ -195,9 +183,8 @@ public abstract class PersistentManagerBase extends ManagerBase
 
 
     /**
-     * Indicates how many seconds old a session can get, after its last use in a
-     * request, before it should be backed up to the store. {@code -1} means sessions
-     * are not backed up.
+     * Indicates how many seconds old a session can get, after its last use in a request, before it should be backed up
+     * to the store. {@code -1} means sessions are not backed up.
      *
      * @return the timeout after which sessions are ripe for back up
      */
@@ -209,43 +196,37 @@ public abstract class PersistentManagerBase extends ManagerBase
 
 
     /**
-     * Sets the option to back sessions up to the Store after they
-     * are used in a request. Sessions remain available in memory
-     * after being backed up, so they are not passivated as they are
-     * when swapped out. The value set indicates how old a session
-     * may get (since its last use) before it must be backed up: {@code -1}
-     * means sessions are not backed up.
+     * Sets the option to back sessions up to the Store after they are used in a request. Sessions remain available in
+     * memory after being backed up, so they are not passivated as they are when swapped out. The value set indicates
+     * how old a session may get (since its last use) before it must be backed up: {@code -1} means sessions are not
+     * backed up.
      * <p>
-     * Note that this is not a hard limit: sessions are checked
-     * against this age limit periodically according to {@code processExpiresFrequency}.
-     * This value should be considered to indicate when a session is
-     * ripe for backing up.
+     * Note that this is not a hard limit: sessions are checked against this age limit periodically according to
+     * {@code processExpiresFrequency}. This value should be considered to indicate when a session is ripe for backing
+     * up.
      * <p>
      * So it is possible that a session may be idle for {@code maxIdleBackup +
      * processExpiresFrequency * engine.backgroundProcessorDelay} seconds, plus the time it takes to handle other
      * session expiration, swapping, etc. tasks.
      *
-     * @param backup The number of seconds after their last accessed
-     * time when they should be written to the Store.
+     * @param backup The number of seconds after their last accessed time when they should be written to the Store.
      */
-    public void setMaxIdleBackup (int backup) {
+    public void setMaxIdleBackup(int backup) {
 
         if (backup == this.maxIdleBackup) {
             return;
         }
         int oldBackup = this.maxIdleBackup;
         this.maxIdleBackup = backup;
-        support.firePropertyChange("maxIdleBackup",
-                                   Integer.valueOf(oldBackup),
-                                   Integer.valueOf(this.maxIdleBackup));
+        support.firePropertyChange("maxIdleBackup", Integer.valueOf(oldBackup), Integer.valueOf(this.maxIdleBackup));
 
     }
 
 
     /**
-     * @return The maximum time in seconds a session may be idle before it is
-     * eligible to be swapped to disk due to inactivity. A value of {@code -1}
-     * means sessions should not be swapped out just because of inactivity.
+     * @return The maximum time in seconds a session may be idle before it is eligible to be swapped to disk due to
+     *             inactivity. A value of {@code -1} means sessions should not be swapped out just because of
+     *             inactivity.
      */
     public int getMaxIdleSwap() {
         return maxIdleSwap;
@@ -253,10 +234,8 @@ public abstract class PersistentManagerBase extends ManagerBase
 
 
     /**
-     * Sets the maximum time in seconds a session may be idle before it is
-     * eligible to be swapped to disk due to inactivity. Setting this to
-     * {@code -1} means sessions should not be swapped out just because of
-     * inactivity.
+     * Sets the maximum time in seconds a session may be idle before it is eligible to be swapped to disk due to
+     * inactivity. Setting this to {@code -1} means sessions should not be swapped out just because of inactivity.
      *
      * @param max time in seconds to wait for possible swap out
      */
@@ -267,17 +246,14 @@ public abstract class PersistentManagerBase extends ManagerBase
         }
         int oldMaxIdleSwap = this.maxIdleSwap;
         this.maxIdleSwap = max;
-        support.firePropertyChange("maxIdleSwap",
-                                   Integer.valueOf(oldMaxIdleSwap),
-                                   Integer.valueOf(this.maxIdleSwap));
+        support.firePropertyChange("maxIdleSwap", Integer.valueOf(oldMaxIdleSwap), Integer.valueOf(this.maxIdleSwap));
     }
 
 
     /**
-     * @return The minimum time in seconds a session must be idle before it is
-     * eligible to be swapped to disk to keep the active session count below
-     * maxActiveSessions. A value of {@code -1} means sessions will not be
-     * swapped out to keep the active session count down.
+     * @return The minimum time in seconds a session must be idle before it is eligible to be swapped to disk to keep
+     *             the active session count below maxActiveSessions. A value of {@code -1} means sessions will not be
+     *             swapped out to keep the active session count down.
      */
     public int getMinIdleSwap() {
         return minIdleSwap;
@@ -285,10 +261,9 @@ public abstract class PersistentManagerBase extends ManagerBase
 
 
     /**
-     * Sets the minimum time in seconds a session must be idle before it is
-     * eligible to be swapped to disk to keep the active session count below
-     * maxActiveSessions. Setting to {@code -1} means sessions will not be
-     * swapped out to keep the active session count down.
+     * Sets the minimum time in seconds a session must be idle before it is eligible to be swapped to disk to keep the
+     * active session count below maxActiveSessions. Setting to {@code -1} means sessions will not be swapped out to
+     * keep the active session count down.
      *
      * @param min time in seconds before a possible swap out
      */
@@ -299,9 +274,7 @@ public abstract class PersistentManagerBase extends ManagerBase
         }
         int oldMinIdleSwap = this.minIdleSwap;
         this.minIdleSwap = min;
-        support.firePropertyChange("minIdleSwap",
-                                   Integer.valueOf(oldMinIdleSwap),
-                                   Integer.valueOf(this.minIdleSwap));
+        support.firePropertyChange("minIdleSwap", Integer.valueOf(oldMinIdleSwap), Integer.valueOf(this.minIdleSwap));
 
     }
 
@@ -310,8 +283,8 @@ public abstract class PersistentManagerBase extends ManagerBase
      * Check, whether a session is loaded in memory
      *
      * @param id The session id for the session to be searched for
-     * @return {@code true}, if the session id is loaded in memory
-     * otherwise {@code false} is returned
+     *
+     * @return {@code true}, if the session id is loaded in memory otherwise {@code false} is returned
      */
     public boolean isLoaded(String id) {
         try {
@@ -332,8 +305,7 @@ public abstract class PersistentManagerBase extends ManagerBase
 
 
     /**
-     * Set the Store object which will manage persistent Session
-     * storage for this Manager.
+     * Set the Store object which will manage persistent Session storage for this Manager.
      *
      * @param store the associated Store
      */
@@ -344,8 +316,7 @@ public abstract class PersistentManagerBase extends ManagerBase
 
 
     /**
-     * @return the Store object which manages persistent Session
-     * storage for this Manager.
+     * @return the Store object which manages persistent Session storage for this Manager.
      */
     @Override
     public Store getStore() {
@@ -354,11 +325,10 @@ public abstract class PersistentManagerBase extends ManagerBase
 
 
     /**
-     * Indicates whether sessions are saved when the Manager is shut down
-     * properly. This requires the {@link #unload()} method to be called.
+     * Indicates whether sessions are saved when the Manager is shut down properly. This requires the {@link #unload()}
+     * method to be called.
      *
-     * @return {@code true}, when sessions should be saved on restart,
-     * {code false} otherwise
+     * @return {@code true}, when sessions should be saved on restart, {code false} otherwise
      */
     public boolean getSaveOnRestart() {
 
@@ -368,13 +338,11 @@ public abstract class PersistentManagerBase extends ManagerBase
 
 
     /**
-     * Set the option to save sessions to the Store when the Manager is
-     * shut down, then loaded when the Manager starts again. If set to
-     * false, any sessions found in the Store may still be picked up when
-     * the Manager is started again.
+     * Set the option to save sessions to the Store when the Manager is shut down, then loaded when the Manager starts
+     * again. If set to false, any sessions found in the Store may still be picked up when the Manager is started again.
      *
-     * @param saveOnRestart {@code true} if sessions should be saved on restart, {@code false} if
-     *     they should be ignored.
+     * @param saveOnRestart {@code true} if sessions should be saved on restart, {@code false} if they should be
+     *                          ignored.
      */
     public void setSaveOnRestart(boolean saveOnRestart) {
 
@@ -384,9 +352,8 @@ public abstract class PersistentManagerBase extends ManagerBase
 
         boolean oldSaveOnRestart = this.saveOnRestart;
         this.saveOnRestart = saveOnRestart;
-        support.firePropertyChange("saveOnRestart",
-                                   Boolean.valueOf(oldSaveOnRestart),
-                                   Boolean.valueOf(this.saveOnRestart));
+        support.firePropertyChange("saveOnRestart", Boolean.valueOf(oldSaveOnRestart),
+                Boolean.valueOf(this.saveOnRestart));
 
     }
 
@@ -430,8 +397,8 @@ public abstract class PersistentManagerBase extends ManagerBase
 
         long timeNow = System.currentTimeMillis();
         Session sessions[] = findSessions();
-        int expireHere = 0 ;
-        if(log.isDebugEnabled()) {
+        int expireHere = 0;
+        if (log.isDebugEnabled()) {
             log.debug("Start expire sessions " + getName() + " at " + timeNow + " sessioncount " + sessions.length);
         }
         for (Session session : sessions) {
@@ -446,8 +413,9 @@ public abstract class PersistentManagerBase extends ManagerBase
         }
 
         long timeEnd = System.currentTimeMillis();
-        if(log.isDebugEnabled()) {
-            log.debug("End expire sessions " + getName() + " processingTime " + (timeEnd - timeNow) + " expired sessions: " + expireHere);
+        if (log.isDebugEnabled()) {
+            log.debug("End expire sessions " + getName() + " processingTime " + (timeEnd - timeNow) +
+                    " expired sessions: " + expireHere);
         }
         processingTime += (timeEnd - timeNow);
 
@@ -455,8 +423,8 @@ public abstract class PersistentManagerBase extends ManagerBase
 
 
     /**
-     * Called by the background thread after active sessions have been checked
-     * for expiration, to allow sessions to be swapped out, backed up, etc.
+     * Called by the background thread after active sessions have been checked for expiration, to allow sessions to be
+     * swapped out, backed up, etc.
      */
     public void processPersistenceChecks() {
 
@@ -470,8 +438,8 @@ public abstract class PersistentManagerBase extends ManagerBase
     /**
      * {@inheritDoc}
      * <p>
-     * This method checks the persistence store if persistence is enabled,
-     * otherwise just uses the functionality from ManagerBase.
+     * This method checks the persistence store if persistence is enabled, otherwise just uses the functionality from
+     * ManagerBase.
      */
     @Override
     public Session findSession(String id) throws IOException {
@@ -483,14 +451,14 @@ public abstract class PersistentManagerBase extends ManagerBase
         // the other code ran swapOut, then we should get a null back during
         // this run, and if not, we lock it out so we can access the session
         // safely.
-        if(session != null) {
-            synchronized(session){
+        if (session != null) {
+            synchronized (session) {
                 session = super.findSession(session.getIdInternal());
-                if(session != null){
-                   // To keep any external calling code from messing up the
-                   // concurrency.
-                   session.access();
-                   session.endAccess();
+                if (session != null) {
+                    // To keep any external calling code from messing up the
+                    // concurrency.
+                    session.access();
+                    session.endAccess();
                 }
             }
         }
@@ -504,8 +472,8 @@ public abstract class PersistentManagerBase extends ManagerBase
     }
 
     /**
-     * Remove this Session from the active Sessions for this Manager,
-     * but not from the Store. (Used by the PersistentValve)
+     * Remove this Session from the active Sessions for this Manager, but not from the Store. (Used by the
+     * PersistentValve)
      *
      * @param session Session to be removed
      */
@@ -515,14 +483,11 @@ public abstract class PersistentManagerBase extends ManagerBase
     }
 
     /**
-     * Load all sessions found in the persistence mechanism, assuming
-     * they are marked as valid and have not passed their expiration
-     * limit. If persistence is not supported, this method returns
-     * without doing anything.
+     * Load all sessions found in the persistence mechanism, assuming they are marked as valid and have not passed their
+     * expiration limit. If persistence is not supported, this method returns without doing anything.
      * <p>
-     * Note that by default, this method is not called by the MiddleManager
-     * class. In order to use it, a subclass must specifically call it,
-     * for example in the start() and/or processPersistenceChecks() methods.
+     * Note that by default, this method is not called by the MiddleManager class. In order to use it, a subclass must
+     * specifically call it, for example in the start() and/or processPersistenceChecks() methods.
      */
     @Override
     public void load() {
@@ -540,8 +505,7 @@ public abstract class PersistentManagerBase extends ManagerBase
                 try {
                     ids = AccessController.doPrivileged(new PrivilegedStoreKeys());
                 } catch (PrivilegedActionException e) {
-                    log.error(sm.getString("persistentManager.storeLoadKeysError"),
-                            e.getException());
+                    log.error(sm.getString("persistentManager.storeLoadKeysError"), e.getException());
                     return;
                 }
             } else {
@@ -580,21 +544,20 @@ public abstract class PersistentManagerBase extends ManagerBase
     @Override
     public void remove(Session session, boolean update) {
 
-        super.remove (session, update);
+        super.remove(session, update);
 
-        if (store != null){
+        if (store != null) {
             removeSession(session.getIdInternal());
         }
     }
 
 
     /**
-     * Remove this Session from the active Sessions for this Manager,
-     * and from the Store.
+     * Remove this Session from the active Sessions for this Manager, and from the Store.
      *
      * @param id Session's id to be removed
      */
-    protected void removeSession(String id){
+    protected void removeSession(String id) {
         try {
             if (SecurityUtil.isPackageProtectionEnabled()) {
                 try {
@@ -611,13 +574,11 @@ public abstract class PersistentManagerBase extends ManagerBase
     }
 
     /**
-     * Save all currently active sessions in the appropriate persistence
-     * mechanism, if any.  If persistence is not supported, this method
-     * returns without doing anything.
+     * Save all currently active sessions in the appropriate persistence mechanism, if any. If persistence is not
+     * supported, this method returns without doing anything.
      * <p>
-     * Note that by default, this method is not called by the MiddleManager
-     * class. In order to use it, a subclass must specifically call it,
-     * for example in the stop() and/or processPersistenceChecks() methods.
+     * Note that by default, this method is not called by the MiddleManager class. In order to use it, a subclass must
+     * specifically call it, for example in the stop() and/or processPersistenceChecks() methods.
      */
     @Override
     public void unload() {
@@ -633,8 +594,7 @@ public abstract class PersistentManagerBase extends ManagerBase
         }
 
         if (log.isDebugEnabled()) {
-            log.debug(sm.getString("persistentManager.unloading",
-                             String.valueOf(n)));
+            log.debug(sm.getString("persistentManager.unloading", String.valueOf(n)));
         }
 
         for (Session session : sessions) {
@@ -679,14 +639,14 @@ public abstract class PersistentManagerBase extends ManagerBase
     // ------------------------------------------------------ Protected Methods
 
     /**
-     * Look for a session in the Store and, if found, restore
-     * it in the Manager's list of active sessions if appropriate.
-     * The session will be removed from the Store after swapping
-     * in, but will not be added to the active session list if it
-     * is invalid or past its expiration.
+     * Look for a session in the Store and, if found, restore it in the Manager's list of active sessions if
+     * appropriate. The session will be removed from the Store after swapping in, but will not be added to the active
+     * session list if it is invalid or past its expiration.
      *
      * @param id The id of the session that should be swapped in
+     *
      * @return restored session, or {@code null}, if none is found
+     *
      * @throws IOException an IO error occurred
      */
     protected Session swapIn(String id) throws IOException {
@@ -698,12 +658,10 @@ public abstract class PersistentManagerBase extends ManagerBase
         Object swapInLock = null;
 
         /*
-         * The purpose of this sync and these locks is to make sure that a
-         * session is only loaded once. It doesn't matter if the lock is removed
-         * and then another thread enters this method and tries to load the same
-         * session. That thread will re-create a swapIn lock for that session,
-         * quickly find that the session is already in sessions, use it and
-         * carry on.
+         * The purpose of this sync and these locks is to make sure that a session is only loaded once. It doesn't
+         * matter if the lock is removed and then another thread enters this method and tries to load the same session.
+         * That thread will re-create a swapIn lock for that session, quickly find that the session is already in
+         * sessions, use it and carry on.
          */
         synchronized (this) {
             swapInLock = sessionSwapInLocks.computeIfAbsent(id, k -> new Object());
@@ -750,15 +708,15 @@ public abstract class PersistentManagerBase extends ManagerBase
     }
 
     private void reactivateLoadedSession(String id, Session session) {
-        if(log.isDebugEnabled()) {
+        if (log.isDebugEnabled()) {
             log.debug(sm.getString("persistentManager.swapIn", id));
         }
 
         session.setManager(this);
         // make sure the listeners know about it.
-        ((StandardSession)session).tellNew();
+        ((StandardSession) session).tellNew();
         add(session);
-        ((StandardSession)session).activate();
+        ((StandardSession) session).activate();
         // endAccess() to ensure timeouts happen correctly.
         // access() to keep access count correct or it will end up
         // negative
@@ -768,14 +726,13 @@ public abstract class PersistentManagerBase extends ManagerBase
 
     private Session loadSessionFromStore(String id) throws IOException {
         try {
-            if (SecurityUtil.isPackageProtectionEnabled()){
+            if (SecurityUtil.isPackageProtectionEnabled()) {
                 return securedStoreLoad(id);
             } else {
-                 return store.load(id);
+                return store.load(id);
             }
         } catch (ClassNotFoundException e) {
-            String msg = sm.getString(
-                    "persistentManager.deserializeError", id);
+            String msg = sm.getString("persistentManager.deserializeError", id);
             log.error(msg, e);
             throw new IllegalStateException(msg, e);
         }
@@ -784,17 +741,14 @@ public abstract class PersistentManagerBase extends ManagerBase
 
     private Session securedStoreLoad(String id) throws IOException, ClassNotFoundException {
         try {
-            return AccessController.doPrivileged(
-                    new PrivilegedStoreLoad(id));
+            return AccessController.doPrivileged(new PrivilegedStoreLoad(id));
         } catch (PrivilegedActionException ex) {
             Exception e = ex.getException();
-            log.error(sm.getString(
-                    "persistentManager.swapInException", id),
-                    e);
-            if (e instanceof IOException){
-                throw (IOException)e;
+            log.error(sm.getString("persistentManager.swapInException", id), e);
+            if (e instanceof IOException) {
+                throw (IOException) e;
             } else if (e instanceof ClassNotFoundException) {
-                throw (ClassNotFoundException)e;
+                throw (ClassNotFoundException) e;
             }
         }
         return null;
@@ -802,12 +756,11 @@ public abstract class PersistentManagerBase extends ManagerBase
 
 
     /**
-     * Remove the session from the Manager's list of active
-     * sessions and write it out to the Store. If the session
-     * is past its expiration or invalid, this method does
-     * nothing.
+     * Remove the session from the Manager's list of active sessions and write it out to the Store. If the session is
+     * past its expiration or invalid, this method does nothing.
      *
      * @param session The Session to write out
+     *
      * @throws IOException an IO error occurred
      */
     protected void swapOut(Session session) throws IOException {
@@ -816,7 +769,7 @@ public abstract class PersistentManagerBase extends ManagerBase
             return;
         }
 
-        ((StandardSession)session).passivate();
+        ((StandardSession) session).passivate();
         writeSession(session);
         super.remove(session, true);
         session.recycle();
@@ -825,10 +778,11 @@ public abstract class PersistentManagerBase extends ManagerBase
 
 
     /**
-     * Write the provided session to the Store without modifying
-     * the copy in memory or triggering passivation events. Does
-     * nothing if the session is invalid or past its expiration.
+     * Write the provided session to the Store without modifying the copy in memory or triggering passivation events.
+     * Does nothing if the session is invalid or past its expiration.
+     *
      * @param session The session that should be written
+     *
      * @throws IOException an IO error occurred
      */
     protected void writeSession(Session session) throws IOException {
@@ -838,19 +792,18 @@ public abstract class PersistentManagerBase extends ManagerBase
         }
 
         try {
-            if (SecurityUtil.isPackageProtectionEnabled()){
-                try{
+            if (SecurityUtil.isPackageProtectionEnabled()) {
+                try {
                     AccessController.doPrivileged(new PrivilegedStoreSave(session));
-                }catch(PrivilegedActionException ex){
+                } catch (PrivilegedActionException ex) {
                     Exception exception = ex.getException();
                     if (exception instanceof IOException) {
                         throw (IOException) exception;
                     }
-                    log.error(sm.getString("persistentManager.serializeError",
-                            session.getIdInternal(), exception));
+                    log.error(sm.getString("persistentManager.serializeError", session.getIdInternal(), exception));
                 }
             } else {
-                 store.save(session);
+                store.save(session);
             }
         } catch (IOException e) {
             log.error(sm.getString("persistentManager.serializeError", session.getIdInternal(), e));
@@ -861,11 +814,11 @@ public abstract class PersistentManagerBase extends ManagerBase
 
 
     /**
-     * Start this component and implement the requirements
-     * of {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
+     * Start this component and implement the requirements of
+     * {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
      *
-     * @exception LifecycleException if this component detects a fatal error
-     *  that prevents this component from being used
+     * @exception LifecycleException if this component detects a fatal error that prevents this component from being
+     *                                   used
      */
     @Override
     protected synchronized void startInternal() throws LifecycleException {
@@ -875,7 +828,7 @@ public abstract class PersistentManagerBase extends ManagerBase
         if (store == null) {
             log.error("No Store configured, persistence disabled");
         } else if (store instanceof Lifecycle) {
-            ((Lifecycle)store).start();
+            ((Lifecycle) store).start();
         }
 
         setState(LifecycleState.STARTING);
@@ -883,11 +836,11 @@ public abstract class PersistentManagerBase extends ManagerBase
 
 
     /**
-     * Stop this component and implement the requirements
-     * of {@link org.apache.catalina.util.LifecycleBase#stopInternal()}.
+     * Stop this component and implement the requirements of
+     * {@link org.apache.catalina.util.LifecycleBase#stopInternal()}.
      *
-     * @exception LifecycleException if this component detects a fatal error
-     *  that prevents this component from being used
+     * @exception LifecycleException if this component detects a fatal error that prevents this component from being
+     *                                   used
      */
     @Override
     protected synchronized void stopInternal() throws LifecycleException {
@@ -913,7 +866,7 @@ public abstract class PersistentManagerBase extends ManagerBase
         }
 
         if (getStore() instanceof Lifecycle) {
-            ((Lifecycle)getStore()).stop();
+            ((Lifecycle) getStore()).stop();
         }
 
         // Require a new random number generator if we are restarted
@@ -945,16 +898,13 @@ public abstract class PersistentManagerBase extends ManagerBase
                     }
                     int timeIdle = (int) (session.getIdleTimeInternal() / 1000L);
                     if (timeIdle >= maxIdleSwap && timeIdle >= minIdleSwap) {
-                        if (session.accessCount != null &&
-                                session.accessCount.get() > 0) {
+                        if (session.accessCount != null && session.accessCount.get() > 0) {
                             // Session is currently being accessed - skip it
                             continue;
                         }
                         if (log.isDebugEnabled()) {
-                            log.debug(sm.getString
-                                    ("persistentManager.swapMaxIdle",
-                                            session.getIdInternal(),
-                                            Integer.valueOf(timeIdle)));
+                            log.debug(sm.getString("persistentManager.swapMaxIdle", session.getIdInternal(),
+                                    Integer.valueOf(timeIdle)));
                         }
                         try {
                             swapOut(session);
@@ -987,29 +937,24 @@ public abstract class PersistentManagerBase extends ManagerBase
             return;
         }
 
-        if(log.isDebugEnabled()) {
-            log.debug(sm.getString
-                ("persistentManager.tooManyActive",
-                 Integer.valueOf(sessions.length)));
+        if (log.isDebugEnabled()) {
+            log.debug(sm.getString("persistentManager.tooManyActive", Integer.valueOf(sessions.length)));
         }
 
         int toswap = sessions.length - limit;
 
         for (int i = 0; i < sessions.length && toswap > 0; i++) {
-            StandardSession session =  (StandardSession) sessions[i];
+            StandardSession session = (StandardSession) sessions[i];
             synchronized (session) {
                 int timeIdle = (int) (session.getIdleTimeInternal() / 1000L);
                 if (timeIdle >= minIdleSwap) {
-                    if (session.accessCount != null &&
-                            session.accessCount.get() > 0) {
+                    if (session.accessCount != null && session.accessCount.get() > 0) {
                         // Session is currently being accessed - skip it
                         continue;
                     }
-                    if(log.isDebugEnabled()) {
-                        log.debug(sm.getString
-                            ("persistentManager.swapTooManyActive",
-                             session.getIdInternal(),
-                             Integer.valueOf(timeIdle)));
+                    if (log.isDebugEnabled()) {
+                        log.debug(sm.getString("persistentManager.swapTooManyActive", session.getIdInternal(),
+                                Integer.valueOf(timeIdle)));
                     }
                     try {
                         swapOut(session);
@@ -1044,8 +989,7 @@ public abstract class PersistentManagerBase extends ManagerBase
                         continue;
                     }
                     long lastAccessedTime = session.getLastAccessedTimeInternal();
-                    Long persistedLastAccessedTime =
-                            (Long) session.getNote(PERSISTED_LAST_ACCESSED_TIME);
+                    Long persistedLastAccessedTime = (Long) session.getNote(PERSISTED_LAST_ACCESSED_TIME);
                     if (persistedLastAccessedTime != null &&
                             lastAccessedTime == persistedLastAccessedTime.longValue()) {
                         continue;
@@ -1053,10 +997,8 @@ public abstract class PersistentManagerBase extends ManagerBase
                     int timeIdle = (int) (session.getIdleTimeInternal() / 1000L);
                     if (timeIdle >= maxIdleBackup) {
                         if (log.isDebugEnabled()) {
-                            log.debug(sm.getString
-                                    ("persistentManager.backupMaxIdle",
-                                            session.getIdInternal(),
-                                            Integer.valueOf(timeIdle)));
+                            log.debug(sm.getString("persistentManager.backupMaxIdle", session.getIdInternal(),
+                                    Integer.valueOf(timeIdle)));
                         }
 
                         try {
@@ -1064,8 +1006,7 @@ public abstract class PersistentManagerBase extends ManagerBase
                         } catch (IOException e) {
                             // This is logged in writeSession()
                         }
-                        session.setNote(PERSISTED_LAST_ACCESSED_TIME,
-                                Long.valueOf(lastAccessedTime));
+                        session.setNote(PERSISTED_LAST_ACCESSED_TIME, Long.valueOf(lastAccessedTime));
                     }
                 }
             }
diff --git a/java/org/apache/catalina/session/StandardManager.java b/java/org/apache/catalina/session/StandardManager.java
index ad3273c2dc..ae42be51c4 100644
--- a/java/org/apache/catalina/session/StandardManager.java
+++ b/java/org/apache/catalina/session/StandardManager.java
@@ -45,14 +45,12 @@ import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
 
 /**
- * Standard implementation of the <b>Manager</b> interface that provides
- * simple session persistence across restarts of this component (such as
- * when the entire server is shut down and restarted, or when a particular
- * web application is reloaded.
+ * Standard implementation of the <b>Manager</b> interface that provides simple session persistence across restarts of
+ * this component (such as when the entire server is shut down and restarted, or when a particular web application is
+ * reloaded.
  * <p>
- * <b>IMPLEMENTATION NOTE</b>:  Correct behavior of session storing and
- * reloading depends upon external calls to the <code>start()</code> and
- * <code>stop()</code> methods of this class at the correct times.
+ * <b>IMPLEMENTATION NOTE</b>: Correct behavior of session storing and reloading depends upon external calls to the
+ * <code>start()</code> and <code>stop()</code> methods of this class at the correct times.
  *
  * @author Craig R. McClanahan
  */
@@ -62,29 +60,27 @@ public class StandardManager extends ManagerBase {
 
     // ---------------------------------------------------- Security Classes
 
-    private class PrivilegedDoLoad
-        implements PrivilegedExceptionAction<Void> {
+    private class PrivilegedDoLoad implements PrivilegedExceptionAction<Void> {
 
         PrivilegedDoLoad() {
             // NOOP
         }
 
         @Override
-        public Void run() throws Exception{
-           doLoad();
-           return null;
+        public Void run() throws Exception {
+            doLoad();
+            return null;
         }
     }
 
-    private class PrivilegedDoUnload
-        implements PrivilegedExceptionAction<Void> {
+    private class PrivilegedDoUnload implements PrivilegedExceptionAction<Void> {
 
         PrivilegedDoUnload() {
             // NOOP
         }
 
         @Override
-        public Void run() throws Exception{
+        public Void run() throws Exception {
             doUnload();
             return null;
         }
@@ -101,12 +97,10 @@ public class StandardManager extends ManagerBase {
 
 
     /**
-     * Path name of the disk file in which active sessions are saved
-     * when we stop, and from which these sessions are loaded when we start.
-     * A <code>null</code> value indicates that no persistence is desired.
-     * If this pathname is relative, it will be resolved against the
-     * temporary working directory provided by our context, available via
-     * the <code>jakarta.servlet.context.tempdir</code> context attribute.
+     * Path name of the disk file in which active sessions are saved when we stop, and from which these sessions are
+     * loaded when we start. A <code>null</code> value indicates that no persistence is desired. If this pathname is
+     * relative, it will be resolved against the temporary working directory provided by our context, available via the
+     * <code>jakarta.servlet.context.tempdir</code> context attribute.
      */
     protected String pathname = null;
 
@@ -128,8 +122,8 @@ public class StandardManager extends ManagerBase {
 
 
     /**
-     * Set the session persistence pathname to the specified value.  If no
-     * persistence support is desired, set the pathname to <code>null</code>.
+     * Set the session persistence pathname to the specified value. If no persistence support is desired, set the
+     * pathname to <code>null</code>.
      *
      * @param pathname New session persistence pathname
      */
@@ -144,15 +138,15 @@ public class StandardManager extends ManagerBase {
 
     @Override
     public void load() throws ClassNotFoundException, IOException {
-        if (SecurityUtil.isPackageProtectionEnabled()){
-            try{
-                AccessController.doPrivileged( new PrivilegedDoLoad() );
-            } catch (PrivilegedActionException ex){
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            try {
+                AccessController.doPrivileged(new PrivilegedDoLoad());
+            } catch (PrivilegedActionException ex) {
                 Exception exception = ex.getException();
                 if (exception instanceof ClassNotFoundException) {
-                    throw (ClassNotFoundException)exception;
+                    throw (ClassNotFoundException) exception;
                 } else if (exception instanceof IOException) {
-                    throw (IOException)exception;
+                    throw (IOException) exception;
                 }
                 if (log.isDebugEnabled()) {
                     log.debug("Unreported exception in load() ", exception);
@@ -165,13 +159,11 @@ public class StandardManager extends ManagerBase {
 
 
     /**
-     * Load any currently active sessions that were previously unloaded
-     * to the appropriate persistence mechanism, if any.  If persistence is not
-     * supported, this method returns without doing anything.
+     * Load any currently active sessions that were previously unloaded to the appropriate persistence mechanism, if
+     * any. If persistence is not supported, this method returns without doing anything.
      *
-     * @exception ClassNotFoundException if a serialized class cannot be
-     *  found during the reload
-     * @exception IOException if an input/output error occurs
+     * @exception ClassNotFoundException if a serialized class cannot be found during the reload
+     * @exception IOException            if an input/output error occurs
      */
     protected void doLoad() throws ClassNotFoundException, IOException {
         if (log.isDebugEnabled()) {
@@ -207,8 +199,7 @@ public class StandardManager extends ManagerBase {
             // Load the previously unloaded active sessions
             synchronized (sessions) {
                 try (ObjectInputStream ois = new CustomObjectInputStream(bis, classLoader, logger,
-                        getSessionAttributeValueClassNamePattern(),
-                        getWarnOnSessionAttributeFilterFailure())) {
+                        getSessionAttributeValueClassNamePattern(), getWarnOnSessionAttributeFilterFailure())) {
                     Integer count = (Integer) ois.readObject();
                     int n = count.intValue();
                     if (log.isDebugEnabled()) {
@@ -255,10 +246,10 @@ public class StandardManager extends ManagerBase {
         if (SecurityUtil.isPackageProtectionEnabled()) {
             try {
                 AccessController.doPrivileged(new PrivilegedDoUnload());
-            } catch (PrivilegedActionException ex){
+            } catch (PrivilegedActionException ex) {
                 Exception exception = ex.getException();
                 if (exception instanceof IOException) {
-                    throw (IOException)exception;
+                    throw (IOException) exception;
                 }
                 if (log.isDebugEnabled()) {
                     log.debug("Unreported exception in unLoad()", exception);
@@ -271,9 +262,8 @@ public class StandardManager extends ManagerBase {
 
 
     /**
-     * Save any currently active sessions in the appropriate persistence
-     * mechanism, if any.  If persistence is not supported, this method
-     * returns without doing anything.
+     * Save any currently active sessions in the appropriate persistence mechanism, if any. If persistence is not
+     * supported, this method returns without doing anything.
      *
      * @exception IOException if an input/output error occurs
      */
@@ -340,11 +330,11 @@ public class StandardManager extends ManagerBase {
 
 
     /**
-     * Start this component and implement the requirements
-     * of {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
+     * Start this component and implement the requirements of
+     * {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
      *
-     * @exception LifecycleException if this component detects a fatal error
-     *  that prevents this component from being used
+     * @exception LifecycleException if this component detects a fatal error that prevents this component from being
+     *                                   used
      */
     @Override
     protected synchronized void startInternal() throws LifecycleException {
@@ -364,11 +354,11 @@ public class StandardManager extends ManagerBase {
 
 
     /**
-     * Stop this component and implement the requirements
-     * of {@link org.apache.catalina.util.LifecycleBase#stopInternal()}.
+     * Stop this component and implement the requirements of
+     * {@link org.apache.catalina.util.LifecycleBase#stopInternal()}.
      *
-     * @exception LifecycleException if this component detects a fatal error
-     *  that prevents this component from being used
+     * @exception LifecycleException if this component detects a fatal error that prevents this component from being
+     *                                   used
      */
     @Override
     protected synchronized void stopInternal() throws LifecycleException {
@@ -411,8 +401,8 @@ public class StandardManager extends ManagerBase {
     // ------------------------------------------------------ Protected Methods
 
     /**
-     * Return a File object representing the pathname to our
-     * persistence file, if any.
+     * Return a File object representing the pathname to our persistence file, if any.
+     *
      * @return the file
      */
     protected File file() {
diff --git a/java/org/apache/catalina/session/StandardSession.java b/java/org/apache/catalina/session/StandardSession.java
index 62346899f0..1272484a9d 100644
--- a/java/org/apache/catalina/session/StandardSession.java
+++ b/java/org/apache/catalina/session/StandardSession.java
@@ -62,19 +62,16 @@ import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.res.StringManager;
 
 /**
- * Standard implementation of the <b>Session</b> interface.  This object is
- * serializable, so that it can be stored in persistent storage or transferred
- * to a different JVM for distributable session support.
+ * Standard implementation of the <b>Session</b> interface. This object is serializable, so that it can be stored in
+ * persistent storage or transferred to a different JVM for distributable session support.
  * <p>
- * <b>IMPLEMENTATION NOTE</b>:  An instance of this class represents both the
- * internal (Session) and application level (HttpSession) view of the session.
- * However, because the class itself is not declared public, Java logic outside
- * of the <code>org.apache.catalina.session</code> package cannot cast an
- * HttpSession view of this instance back to a Session view.
+ * <b>IMPLEMENTATION NOTE</b>: An instance of this class represents both the internal (Session) and application level
+ * (HttpSession) view of the session. However, because the class itself is not declared public, Java logic outside of
+ * the <code>org.apache.catalina.session</code> package cannot cast an HttpSession view of this instance back to a
+ * Session view.
  * <p>
- * <b>IMPLEMENTATION NOTE</b>:  If you add fields to this class, you must
- * make sure that you carry them over in the read/writeObject methods so
- * that this class is properly serialized.
+ * <b>IMPLEMENTATION NOTE</b>: If you add fields to this class, you must make sure that you carry them over in the
+ * read/writeObject methods so that this class is properly serialized.
  *
  * @author Craig R. McClanahan
  * @author Sean Legassick
@@ -123,35 +120,32 @@ public class StandardSession implements HttpSession, Session, Serializable {
     /**
      * The collection of user data attributes associated with this Session.
      */
-    protected ConcurrentMap<String, Object> attributes = new ConcurrentHashMap<>();
+    protected ConcurrentMap<String,Object> attributes = new ConcurrentHashMap<>();
 
 
     /**
-     * The authentication type used to authenticate our cached Principal,
-     * if any.  NOTE:  This value is not included in the serialized
-     * version of this object.
+     * The authentication type used to authenticate our cached Principal, if any. NOTE: This value is not included in
+     * the serialized version of this object.
      */
     protected transient String authType = null;
 
 
     /**
-     * The time this session was created, in milliseconds since midnight,
-     * January 1, 1970 GMT.
+     * The time this session was created, in milliseconds since midnight, January 1, 1970 GMT.
      */
     protected long creationTime = 0L;
 
 
     /**
-     * We are currently processing a session expiration, so bypass
-     * certain IllegalStateException tests.  NOTE:  This value is not
-     * included in the serialized version of this object.
+     * We are currently processing a session expiration, so bypass certain IllegalStateException tests. NOTE: This value
+     * is not included in the serialized version of this object.
      */
     protected transient volatile boolean expiring = false;
 
 
     /**
-     * The facade associated with this session.  NOTE:  This value is not
-     * included in the serialized version of this object.
+     * The facade associated with this session. NOTE: This value is not included in the serialized version of this
+     * object.
      */
     protected transient StandardSessionFacade facade = null;
 
@@ -181,9 +175,8 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * The maximum time interval, in seconds, between client requests before
-     * the servlet container may invalidate this session.  A negative time
-     * indicates that the session should never time out.
+     * The maximum time interval, in seconds, between client requests before the servlet container may invalidate this
+     * session. A negative time indicates that the session should never time out.
      */
     protected volatile int maxInactiveInterval = -1;
 
@@ -201,17 +194,15 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Internal notes associated with this session by Catalina components
-     * and event listeners.  <b>IMPLEMENTATION NOTE:</b> This object is
-     * <em>not</em> saved and restored across session serializations!
+     * Internal notes associated with this session by Catalina components and event listeners. <b>IMPLEMENTATION
+     * NOTE:</b> This object is <em>not</em> saved and restored across session serializations!
      */
-    protected transient Map<String, Object> notes = new ConcurrentHashMap<>();
+    protected transient Map<String,Object> notes = new ConcurrentHashMap<>();
 
 
     /**
-     * The authenticated Principal associated with this session, if any.
-     * <b>IMPLEMENTATION NOTE:</b>  This object is <i>not</i> saved and
-     * restored across session serializations!
+     * The authenticated Principal associated with this session, if any. <b>IMPLEMENTATION NOTE:</b> This object is
+     * <i>not</i> saved and restored across session serializations!
      */
     protected transient Principal principal = null;
 
@@ -223,11 +214,10 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * The property change support for this component.  NOTE:  This value
-     * is not included in the serialized version of this object.
+     * The property change support for this component. NOTE: This value is not included in the serialized version of
+     * this object.
      */
-    protected final transient PropertyChangeSupport support =
-        new PropertyChangeSupport(this);
+    protected final transient PropertyChangeSupport support = new PropertyChangeSupport(this);
 
 
     /**
@@ -258,8 +248,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Return the authentication type used to authenticate our cached
-     * Principal, if any.
+     * Return the authentication type used to authenticate our cached Principal, if any.
      */
     @Override
     public String getAuthType() {
@@ -268,8 +257,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Set the authentication type used to authenticate our cached
-     * Principal, if any.
+     * Set the authentication type used to authenticate our cached Principal, if any.
      *
      * @param authType The new cached authentication type
      */
@@ -282,8 +270,8 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Set the creation time for this session.  This method is called by the
-     * Manager when an existing Session instance is reused.
+     * Set the creation time for this session. This method is called by the Manager when an existing Session instance is
+     * reused.
      *
      * @param time The new creation time
      */
@@ -350,7 +338,6 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
     /**
      * Inform the listeners about the new session.
-     *
      */
     public void tellNew() {
 
@@ -361,8 +348,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
         Context context = manager.getContext();
         Object listeners[] = context.getApplicationLifecycleListeners();
         if (listeners != null && listeners.length > 0) {
-            HttpSessionEvent event =
-                new HttpSessionEvent(getSession());
+            HttpSessionEvent event = new HttpSessionEvent(getSession());
             for (Object o : listeners) {
                 if (!(o instanceof HttpSessionListener)) {
                     continue;
@@ -379,7 +365,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
                     } catch (Exception e) {
                         // Ignore
                     }
-                    manager.getContext().getLogger().error (sm.getString("standardSession.sessionEvent"), t);
+                    manager.getContext().getLogger().error(sm.getString("standardSession.sessionEvent"), t);
                 }
             }
         }
@@ -389,42 +375,38 @@ public class StandardSession implements HttpSession, Session, Serializable {
     /**
      * Inform the listeners about the change session ID.
      *
-     * @param newId  new session ID
-     * @param oldId  old session ID
-     * @param notifySessionListeners  Should any associated sessionListeners be
-     *        notified that session ID has been changed?
-     * @param notifyContainerListeners  Should any associated ContainerListeners
-     *        be notified that session ID has been changed?
+     * @param newId                    new session ID
+     * @param oldId                    old session ID
+     * @param notifySessionListeners   Should any associated sessionListeners be notified that session ID has been
+     *                                     changed?
+     * @param notifyContainerListeners Should any associated ContainerListeners be notified that session ID has been
+     *                                     changed?
      */
     @Override
-    public void tellChangedSessionId(String newId, String oldId,
-            boolean notifySessionListeners, boolean notifyContainerListeners) {
+    public void tellChangedSessionId(String newId, String oldId, boolean notifySessionListeners,
+            boolean notifyContainerListeners) {
         Context context = manager.getContext();
-         // notify ContainerListeners
+        // notify ContainerListeners
         if (notifyContainerListeners) {
-            context.fireContainerEvent(Context.CHANGE_SESSION_ID_EVENT,
-                    new String[] {oldId, newId});
+            context.fireContainerEvent(Context.CHANGE_SESSION_ID_EVENT, new String[] { oldId, newId });
         }
 
         // notify HttpSessionIdListener
         if (notifySessionListeners) {
             Object listeners[] = context.getApplicationEventListeners();
             if (listeners != null && listeners.length > 0) {
-                HttpSessionEvent event =
-                    new HttpSessionEvent(getSession());
+                HttpSessionEvent event = new HttpSessionEvent(getSession());
 
-                for(Object listener : listeners) {
+                for (Object listener : listeners) {
                     if (!(listener instanceof HttpSessionIdListener)) {
                         continue;
                     }
 
-                    HttpSessionIdListener idListener =
-                        (HttpSessionIdListener)listener;
+                    HttpSessionIdListener idListener = (HttpSessionIdListener) listener;
                     try {
                         idListener.sessionIdChanged(event, oldId);
                     } catch (Throwable t) {
-                        manager.getContext().getLogger().error
-                            (sm.getString("standardSession.sessionEvent"), t);
+                        manager.getContext().getLogger().error(sm.getString("standardSession.sessionEvent"), t);
                     }
                 }
             }
@@ -433,18 +415,15 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Return the last time the client sent a request associated with this
-     * session, as the number of milliseconds since midnight, January 1, 1970
-     * GMT.  Actions that your application takes, such as getting or setting
-     * a value associated with the session, do not affect the access time.
-     * This one gets updated whenever a request starts.
+     * Return the last time the client sent a request associated with this session, as the number of milliseconds since
+     * midnight, January 1, 1970 GMT. Actions that your application takes, such as getting or setting a value associated
+     * with the session, do not affect the access time. This one gets updated whenever a request starts.
      */
     @Override
     public long getThisAccessedTime() {
 
         if (!isValidInternal()) {
-            throw new IllegalStateException
-                (sm.getString("standardSession.getThisAccessedTime.ise"));
+            throw new IllegalStateException(sm.getString("standardSession.getThisAccessedTime.ise"));
         }
 
         return this.thisAccessedTime;
@@ -452,6 +431,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
     /**
      * Return the last client access time without invalidation check
+     *
      * @see #getThisAccessedTime()
      */
     @Override
@@ -460,18 +440,15 @@ public class StandardSession implements HttpSession, Session, Serializable {
     }
 
     /**
-     * Return the last time the client sent a request associated with this
-     * session, as the number of milliseconds since midnight, January 1, 1970
-     * GMT.  Actions that your application takes, such as getting or setting
-     * a value associated with the session, do not affect the access time.
-     * This one gets updated whenever a request finishes.
+     * Return the last time the client sent a request associated with this session, as the number of milliseconds since
+     * midnight, January 1, 1970 GMT. Actions that your application takes, such as getting or setting a value associated
+     * with the session, do not affect the access time. This one gets updated whenever a request finishes.
      */
     @Override
     public long getLastAccessedTime() {
 
         if (!isValidInternal()) {
-            throw new IllegalStateException
-                (sm.getString("standardSession.getLastAccessedTime.ise"));
+            throw new IllegalStateException(sm.getString("standardSession.getLastAccessedTime.ise"));
         }
 
         return this.lastAccessedTime;
@@ -479,6 +456,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
     /**
      * Return the last client access time without invalidation check
+     *
      * @see #getLastAccessedTime()
      */
     @Override
@@ -493,8 +471,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
     public long getIdleTime() {
 
         if (!isValidInternal()) {
-            throw new IllegalStateException
-                (sm.getString("standardSession.getIdleTime.ise"));
+            throw new IllegalStateException(sm.getString("standardSession.getIdleTime.ise"));
         }
 
         return getIdleTimeInternal();
@@ -502,6 +479,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
     /**
      * Return the idle time from last client access time without invalidation check
+     *
      * @see #getIdleTime()
      */
     @Override
@@ -537,9 +515,8 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Return the maximum time interval, in seconds, between client requests
-     * before the servlet container will invalidate the session.  A negative
-     * time indicates that the session should never time out.
+     * Return the maximum time interval, in seconds, between client requests before the servlet container will
+     * invalidate the session. A negative time indicates that the session should never time out.
      */
     @Override
     public int getMaxInactiveInterval() {
@@ -548,9 +525,8 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Set the maximum time interval, in seconds, between client requests
-     * before the servlet container will invalidate the session.  A zero or
-     * negative time indicates that the session should never time out.
+     * Set the maximum time interval, in seconds, between client requests before the servlet container will invalidate
+     * the session. A zero or negative time indicates that the session should never time out.
      *
      * @param interval The new maximum interval
      */
@@ -572,11 +548,10 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Return the authenticated Principal that is associated with this Session.
-     * This provides an <code>Authenticator</code> with a means to cache a
-     * previously authenticated Principal, and avoid potentially expensive
-     * <code>Realm.authenticate()</code> calls on every request.  If there
-     * is no current associated Principal, return <code>null</code>.
+     * Return the authenticated Principal that is associated with this Session. This provides an
+     * <code>Authenticator</code> with a means to cache a previously authenticated Principal, and avoid potentially
+     * expensive <code>Realm.authenticate()</code> calls on every request. If there is no current associated Principal,
+     * return <code>null</code>.
      */
     @Override
     public Principal getPrincipal() {
@@ -585,9 +560,8 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Set the authenticated Principal that is associated with this Session.
-     * This provides an <code>Authenticator</code> with a means to cache a
-     * previously authenticated Principal, and avoid potentially expensive
+     * Set the authenticated Principal that is associated with this Session. This provides an <code>Authenticator</code>
+     * with a means to cache a previously authenticated Principal, and avoid potentially expensive
      * <code>Realm.authenticate()</code> calls on every request.
      *
      * @param principal The new Principal, or <code>null</code> if none
@@ -603,8 +577,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Return the <code>HttpSession</code> for which this object
-     * is the facade.
+     * Return the <code>HttpSession</code> for which this object is the facade.
      */
     @Override
     public HttpSession getSession() {
@@ -663,9 +636,8 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Update the accessed time information for this session.  This method
-     * should be called by the context when a request comes in for a particular
-     * session, even if the application does not reference it.
+     * Update the accessed time information for this session. This method should be called by the context when a request
+     * comes in for a particular session, even if the application does not reference it.
      */
     @Override
     public void access() {
@@ -688,8 +660,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
         isNew = false;
 
         /*
-         * The servlet spec mandates to ignore request handling time
-         * in lastAccessedTime.
+         * The servlet spec mandates to ignore request handling time in lastAccessedTime.
          */
         if (lastAccessAtStart) {
             this.lastAccessedTime = this.thisAccessedTime;
@@ -718,8 +689,8 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Perform the internal processing required to invalidate this session,
-     * without triggering an exception if the session has already expired.
+     * Perform the internal processing required to invalidate this session, without triggering an exception if the
+     * session has already expired.
      */
     @Override
     public void expire() {
@@ -730,11 +701,10 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Perform the internal processing required to invalidate this session,
-     * without triggering an exception if the session has already expired.
+     * Perform the internal processing required to invalidate this session, without triggering an exception if the
+     * session has already expired.
      *
-     * @param notify Should we notify listeners about the demise of
-     *  this session?
+     * @param notify Should we notify listeners about the demise of this session?
      */
     public void expire(boolean notify) {
 
@@ -774,31 +744,25 @@ public class StandardSession implements HttpSession, Session, Serializable {
                     oldContextClassLoader = context.bind(Globals.IS_SECURITY_ENABLED, null);
                     Object listeners[] = context.getApplicationLifecycleListeners();
                     if (listeners != null && listeners.length > 0) {
-                        HttpSessionEvent event =
-                            new HttpSessionEvent(getSession());
+                        HttpSessionEvent event = new HttpSessionEvent(getSession());
                         for (int i = 0; i < listeners.length; i++) {
                             int j = (listeners.length - 1) - i;
                             if (!(listeners[j] instanceof HttpSessionListener)) {
                                 continue;
                             }
-                            HttpSessionListener listener =
-                                (HttpSessionListener) listeners[j];
+                            HttpSessionListener listener = (HttpSessionListener) listeners[j];
                             try {
-                                context.fireContainerEvent("beforeSessionDestroyed",
-                                        listener);
+                                context.fireContainerEvent("beforeSessionDestroyed", listener);
                                 listener.sessionDestroyed(event);
-                                context.fireContainerEvent("afterSessionDestroyed",
-                                        listener);
+                                context.fireContainerEvent("afterSessionDestroyed", listener);
                             } catch (Throwable t) {
                                 ExceptionUtils.handleThrowable(t);
                                 try {
-                                    context.fireContainerEvent(
-                                            "afterSessionDestroyed", listener);
+                                    context.fireContainerEvent("afterSessionDestroyed", listener);
                                 } catch (Exception e) {
                                     // Ignore
                                 }
-                                manager.getContext().getLogger().error
-                                    (sm.getString("standardSession.sessionEvent"), t);
+                                manager.getContext().getLogger().error(sm.getString("standardSession.sessionEvent"), t);
                             }
                         }
                     }
@@ -825,9 +789,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
                 try {
                     gp.logout();
                 } catch (Exception e) {
-                    manager.getContext().getLogger().error(
-                            sm.getString("standardSession.logoutfail"),
-                            e);
+                    manager.getContext().getLogger().error(sm.getString("standardSession.logoutfail"), e);
                 }
             }
 
@@ -852,8 +814,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Perform the internal processing required to passivate
-     * this session.
+     * Perform the internal processing required to passivate this session.
      */
     public void passivate() {
 
@@ -882,8 +843,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Perform internal processing required to activate this
-     * session.
+     * Perform internal processing required to activate this session.
      */
     public void activate() {
 
@@ -916,8 +876,8 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Return the object bound with the specified name to the internal notes
-     * for this session, or <code>null</code> if no such binding exists.
+     * Return the object bound with the specified name to the internal notes for this session, or <code>null</code> if
+     * no such binding exists.
      *
      * @param name Name of the note to be returned
      */
@@ -928,8 +888,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Return an Iterator containing the String names of all notes bindings
-     * that exist for this session.
+     * Return an Iterator containing the String names of all notes bindings that exist for this session.
      */
     @Override
     public Iterator<String> getNoteNames() {
@@ -938,8 +897,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Release all object references, and initialize instance variables, in
-     * preparation for reuse of this object.
+     * Release all object references, and initialize instance variables, in preparation for reuse of this object.
      */
     @Override
     public void recycle() {
@@ -962,8 +920,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Remove any object bound to the specified name in the internal notes
-     * for this session.
+     * Remove any object bound to the specified name in the internal notes for this session.
      *
      * @param name Name of the note to be removed
      */
@@ -987,10 +944,10 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Bind an object to a specified name in the internal notes associated
-     * with this session, replacing any existing binding for this name.
+     * Bind an object to a specified name in the internal notes associated with this session, replacing any existing
+     * binding for this name.
      *
-     * @param name Name to which the object should be bound
+     * @param name  Name to which the object should be bound
      * @param value Object to be bound to the specified name
      */
     @Override
@@ -1018,17 +975,15 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Read a serialized version of the contents of this session object from
-     * the specified object input stream, without requiring that the
-     * StandardSession itself have been serialized.
+     * Read a serialized version of the contents of this session object from the specified object input stream, without
+     * requiring that the StandardSession itself have been serialized.
      *
      * @param stream The object input stream to read from
      *
      * @exception ClassNotFoundException if an unknown class is specified
-     * @exception IOException if an input/output error occurs
+     * @exception IOException            if an input/output error occurs
      */
-    public void readObjectData(ObjectInputStream stream)
-        throws ClassNotFoundException, IOException {
+    public void readObjectData(ObjectInputStream stream) throws ClassNotFoundException, IOException {
 
         doReadObject(stream);
 
@@ -1036,16 +991,14 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Write a serialized version of the contents of this session object to
-     * the specified object output stream, without requiring that the
-     * StandardSession itself have been serialized.
+     * Write a serialized version of the contents of this session object to the specified object output stream, without
+     * requiring that the StandardSession itself have been serialized.
      *
      * @param stream The object output stream to write to
      *
      * @exception IOException if an input/output error occurs
      */
-    public void writeObjectData(ObjectOutputStream stream)
-        throws IOException {
+    public void writeObjectData(ObjectOutputStream stream) throws IOException {
 
         doWriteObject(stream);
 
@@ -1056,17 +1009,14 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Return the time when this session was created, in milliseconds since
-     * midnight, January 1, 1970 GMT.
+     * Return the time when this session was created, in milliseconds since midnight, January 1, 1970 GMT.
      *
-     * @exception IllegalStateException if this method is called on an
-     *  invalidated session
+     * @exception IllegalStateException if this method is called on an invalidated session
      */
     @Override
     public long getCreationTime() {
         if (!isValidInternal()) {
-            throw new IllegalStateException
-                (sm.getString("standardSession.getCreationTime.ise"));
+            throw new IllegalStateException(sm.getString("standardSession.getCreationTime.ise"));
         }
 
         return this.creationTime;
@@ -1074,8 +1024,8 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Return the time when this session was created, in milliseconds since
-     * midnight, January 1, 1970 GMT, bypassing the session validation checks.
+     * Return the time when this session was created, in milliseconds since midnight, January 1, 1970 GMT, bypassing the
+     * session validation checks.
      */
     @Override
     public long getCreationTimeInternal() {
@@ -1099,19 +1049,17 @@ public class StandardSession implements HttpSession, Session, Serializable {
     // ----------------------------------------------HttpSession Public Methods
 
     /**
-     * Return the object bound with the specified name in this session, or
-     * <code>null</code> if no object is bound with that name.
+     * Return the object bound with the specified name in this session, or <code>null</code> if no object is bound with
+     * that name.
      *
      * @param name Name of the attribute to be returned
      *
-     * @exception IllegalStateException if this method is called on an
-     *  invalidated session
+     * @exception IllegalStateException if this method is called on an invalidated session
      */
     @Override
     public Object getAttribute(String name) {
         if (!isValidInternal()) {
-            throw new IllegalStateException
-                (sm.getString("standardSession.getAttribute.ise"));
+            throw new IllegalStateException(sm.getString("standardSession.getAttribute.ise"));
         }
 
         if (name == null) {
@@ -1123,18 +1071,16 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Return an <code>Enumeration</code> of <code>String</code> objects
-     * containing the names of the objects bound to this session.
+     * Return an <code>Enumeration</code> of <code>String</code> objects containing the names of the objects bound to
+     * this session.
      *
-     * @exception IllegalStateException if this method is called on an
-     *  invalidated session
+     * @exception IllegalStateException if this method is called on an invalidated session
      */
     @Override
     public Enumeration<String> getAttributeNames() {
 
         if (!isValidInternal()) {
-            throw new IllegalStateException
-                (sm.getString("standardSession.getAttributeNames.ise"));
+            throw new IllegalStateException(sm.getString("standardSession.getAttributeNames.ise"));
         }
 
         Set<String> names = new HashSet<>(attributes.keySet());
@@ -1145,15 +1091,13 @@ public class StandardSession implements HttpSession, Session, Serializable {
     /**
      * Invalidates this session and unbinds any objects bound to it.
      *
-     * @exception IllegalStateException if this method is called on
-     *  an invalidated session
+     * @exception IllegalStateException if this method is called on an invalidated session
      */
     @Override
     public void invalidate() {
 
         if (!isValidInternal()) {
-            throw new IllegalStateException
-                (sm.getString("standardSession.invalidate.ise"));
+            throw new IllegalStateException(sm.getString("standardSession.invalidate.ise"));
         }
 
         // Cause this session to expire
@@ -1163,20 +1107,16 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Return <code>true</code> if the client does not yet know about the
-     * session, or if the client chooses not to join the session.  For
-     * example, if the server used only cookie-based sessions, and the client
-     * has disabled the use of cookies, then a session would be new on each
-     * request.
+     * Return <code>true</code> if the client does not yet know about the session, or if the client chooses not to join
+     * the session. For example, if the server used only cookie-based sessions, and the client has disabled the use of
+     * cookies, then a session would be new on each request.
      *
-     * @exception IllegalStateException if this method is called on an
-     *  invalidated session
+     * @exception IllegalStateException if this method is called on an invalidated session
      */
     @Override
     public boolean isNew() {
         if (!isValidInternal()) {
-            throw new IllegalStateException
-                (sm.getString("standardSession.isNew.ise"));
+            throw new IllegalStateException(sm.getString("standardSession.isNew.ise"));
         }
 
         return this.isNew;
@@ -1184,18 +1124,15 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Remove the object bound with the specified name from this session.  If
-     * the session does not have an object bound with this name, this method
-     * does nothing.
+     * Remove the object bound with the specified name from this session. If the session does not have an object bound
+     * with this name, this method does nothing.
      * <p>
-     * After this method executes, and if the object implements
-     * <code>HttpSessionBindingListener</code>, the container calls
-     * <code>valueUnbound()</code> on the object.
+     * After this method executes, and if the object implements <code>HttpSessionBindingListener</code>, the container
+     * calls <code>valueUnbound()</code> on the object.
      *
      * @param name Name of the object to remove from this session.
      *
-     * @exception IllegalStateException if this method is called on an
-     *  invalidated session
+     * @exception IllegalStateException if this method is called on an invalidated session
      */
     @Override
     public void removeAttribute(String name) {
@@ -1206,27 +1143,22 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Remove the object bound with the specified name from this session.  If
-     * the session does not have an object bound with this name, this method
-     * does nothing.
+     * Remove the object bound with the specified name from this session. If the session does not have an object bound
+     * with this name, this method does nothing.
      * <p>
-     * After this method executes, and if the object implements
-     * <code>HttpSessionBindingListener</code>, the container calls
-     * <code>valueUnbound()</code> on the object.
+     * After this method executes, and if the object implements <code>HttpSessionBindingListener</code>, the container
+     * calls <code>valueUnbound()</code> on the object.
      *
-     * @param name Name of the object to remove from this session.
-     * @param notify Should we notify interested listeners that this
-     *  attribute is being removed?
+     * @param name   Name of the object to remove from this session.
+     * @param notify Should we notify interested listeners that this attribute is being removed?
      *
-     * @exception IllegalStateException if this method is called on an
-     *  invalidated session
+     * @exception IllegalStateException if this method is called on an invalidated session
      */
     public void removeAttribute(String name, boolean notify) {
 
         // Validate our current state
         if (!isValidInternal()) {
-            throw new IllegalStateException
-                (sm.getString("standardSession.removeAttribute.ise"));
+            throw new IllegalStateException(sm.getString("standardSession.removeAttribute.ise"));
         }
 
         removeAttributeInternal(name, notify);
@@ -1235,51 +1167,45 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Bind an object to this session, using the specified name.  If an object
-     * of the same name is already bound to this session, the object is
-     * replaced.
+     * Bind an object to this session, using the specified name. If an object of the same name is already bound to this
+     * session, the object is replaced.
      * <p>
-     * After this method executes, and if the object implements
-     * <code>HttpSessionBindingListener</code>, the container calls
-     * <code>valueBound()</code> on the object.
+     * After this method executes, and if the object implements <code>HttpSessionBindingListener</code>, the container
+     * calls <code>valueBound()</code> on the object.
      *
-     * @param name Name to which the object is bound, cannot be null
+     * @param name  Name to which the object is bound, cannot be null
      * @param value Object to be bound, cannot be null
      *
-     * @exception IllegalArgumentException if an attempt is made to add a
-     *  non-serializable object in an environment marked distributable.
-     * @exception IllegalStateException if this method is called on an
-     *  invalidated session
+     * @exception IllegalArgumentException if an attempt is made to add a non-serializable object in an environment
+     *                                         marked distributable.
+     * @exception IllegalStateException    if this method is called on an invalidated session
      */
     @Override
     public void setAttribute(String name, Object value) {
-        setAttribute(name,value,true);
+        setAttribute(name, value, true);
     }
 
 
     /**
-     * Bind an object to this session, using the specified name.  If an object
-     * of the same name is already bound to this session, the object is
-     * replaced.
+     * Bind an object to this session, using the specified name. If an object of the same name is already bound to this
+     * session, the object is replaced.
      * <p>
-     * After this method executes, and if the object implements
-     * <code>HttpSessionBindingListener</code>, the container calls
-     * <code>valueBound()</code> on the object.
+     * After this method executes, and if the object implements <code>HttpSessionBindingListener</code>, the container
+     * calls <code>valueBound()</code> on the object.
      *
-     * @param name Name to which the object is bound, cannot be null
-     * @param value Object to be bound, cannot be null
+     * @param name   Name to which the object is bound, cannot be null
+     * @param value  Object to be bound, cannot be null
      * @param notify whether to notify session listeners
-     * @exception IllegalArgumentException if an attempt is made to add a
-     *  non-serializable object in an environment marked distributable.
-     * @exception IllegalStateException if this method is called on an
-     *  invalidated session
+     *
+     * @exception IllegalArgumentException if an attempt is made to add a non-serializable object in an environment
+     *                                         marked distributable.
+     * @exception IllegalStateException    if this method is called on an invalidated session
      */
     public void setAttribute(String name, Object value, boolean notify) {
 
         // Name cannot be null
         if (name == null) {
-            throw new IllegalArgumentException(
-                    sm.getString("standardSession.setAttribute.namenull"));
+            throw new IllegalArgumentException(sm.getString("standardSession.setAttribute.namenull"));
         }
 
         // Null value is the same as removeAttribute()
@@ -1290,8 +1216,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
         // Validate our current state
         if (!isValidInternal()) {
-            throw new IllegalStateException(
-                    sm.getString("standardSession.setAttribute.ise", getIdInternal()));
+            throw new IllegalStateException(sm.getString("standardSession.setAttribute.ise", getIdInternal()));
         }
 
         Context context = manager.getContext();
@@ -1311,9 +1236,8 @@ public class StandardSession implements HttpSession, Session, Serializable {
                 event = new HttpSessionBindingEvent(getSession(), name, value);
                 try {
                     ((HttpSessionBindingListener) value).valueBound(event);
-                } catch (Throwable t){
-                    manager.getContext().getLogger().error(
-                            sm.getString("standardSession.bindingEvent"), t);
+                } catch (Throwable t) {
+                    manager.getContext().getLogger().error(sm.getString("standardSession.bindingEvent"), t);
                 }
             }
         }
@@ -1327,12 +1251,11 @@ public class StandardSession implements HttpSession, Session, Serializable {
             // unless configured to do so
             if (unbound != value || manager.getNotifyBindingListenerOnUnchangedValue()) {
                 try {
-                    ((HttpSessionBindingListener) unbound).valueUnbound
-                        (new HttpSessionBindingEvent(getSession(), name));
+                    ((HttpSessionBindingListener) unbound)
+                            .valueUnbound(new HttpSessionBindingEvent(getSession(), name));
                 } catch (Throwable t) {
                     ExceptionUtils.handleThrowable(t);
-                    manager.getContext().getLogger().error
-                        (sm.getString("standardSession.bindingEvent"), t);
+                    manager.getContext().getLogger().error(sm.getString("standardSession.bindingEvent"), t);
                 }
             }
         }
@@ -1373,8 +1296,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
                 ExceptionUtils.handleThrowable(t);
                 try {
                     if (unbound != null) {
-                        if (unbound != value ||
-                                manager.getNotifyAttributeListenerOnUnchangedValue()) {
+                        if (unbound != value || manager.getNotifyAttributeListenerOnUnchangedValue()) {
                             context.fireContainerEvent("afterSessionAttributeReplaced", listener);
                         }
                     } else {
@@ -1383,8 +1305,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
                 } catch (Exception e) {
                     // Ignore
                 }
-                manager.getContext().getLogger().error(
-                        sm.getString("standardSession.attributeEvent"), t);
+                manager.getContext().getLogger().error(sm.getString("standardSession.attributeEvent"), t);
             }
         }
     }
@@ -1393,8 +1314,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
     // ------------------------------------------ HttpSession Protected Methods
 
     /**
-     * @return the <code>isValid</code> flag for this session without any expiration
-     * check.
+     * @return the <code>isValid</code> flag for this session without any expiration check.
      */
     protected boolean isValidInternal() {
         return this.isValid;
@@ -1403,9 +1323,8 @@ public class StandardSession implements HttpSession, Session, Serializable {
     /**
      * {@inheritDoc}
      * <p>
-     * This implementation simply checks the value for serializability.
-     * Sub-classes might use other distribution technology not based on
-     * serialization and can override this check.
+     * This implementation simply checks the value for serializability. Sub-classes might use other distribution
+     * technology not based on serialization and can override this check.
      */
     @Override
     public boolean isAttributeDistributable(String name, Object value) {
@@ -1414,46 +1333,40 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Read a serialized version of this session object from the specified
-     * object input stream.
+     * Read a serialized version of this session object from the specified object input stream.
      * <p>
-     * <b>IMPLEMENTATION NOTE</b>:  The reference to the owning Manager
-     * is not restored by this method, and must be set explicitly.
+     * <b>IMPLEMENTATION NOTE</b>: The reference to the owning Manager is not restored by this method, and must be set
+     * explicitly.
      *
      * @param stream The input stream to read from
      *
      * @exception ClassNotFoundException if an unknown class is specified
-     * @exception IOException if an input/output error occurs
+     * @exception IOException            if an input/output error occurs
      */
-    protected void doReadObject(ObjectInputStream stream)
-        throws ClassNotFoundException, IOException {
+    protected void doReadObject(ObjectInputStream stream) throws ClassNotFoundException, IOException {
 
         // Deserialize the scalar instance variables (except Manager)
-        authType = null;        // Transient (may be set later)
+        authType = null; // Transient (may be set later)
         creationTime = ((Long) stream.readObject()).longValue();
         lastAccessedTime = ((Long) stream.readObject()).longValue();
         maxInactiveInterval = ((Integer) stream.readObject()).intValue();
         isNew = ((Boolean) stream.readObject()).booleanValue();
         isValid = ((Boolean) stream.readObject()).booleanValue();
         thisAccessedTime = ((Long) stream.readObject()).longValue();
-        principal = null;        // Transient (may be set later)
-        //        setId((String) stream.readObject());
+        principal = null; // Transient (may be set later)
+        // setId((String) stream.readObject());
         id = (String) stream.readObject();
         if (manager.getContext().getLogger().isDebugEnabled()) {
-            manager.getContext().getLogger().debug
-                ("readObject() loading session " + id);
+            manager.getContext().getLogger().debug("readObject() loading session " + id);
         }
 
         if (notes == null) {
             notes = new ConcurrentHashMap<>();
         }
         /*
-         * The next object read could either be the number of attributes
-         * (Integer) or if authentication information is persisted then:
-         * - authType (String)   - always present
-         * - Principal object    - always present
-         * - expected session ID - present if BZ 66120 is fixed
-         * - saved request       - present if BZ 66120 is fixed
+         * The next object read could either be the number of attributes (Integer) or if authentication information is
+         * persisted then: - authType (String) - always present - Principal object - always present - expected session
+         * ID - present if BZ 66120 is fixed - saved request - present if BZ 66120 is fixed
          *
          * Note: Some, all or none of the above objects may be null
          */
@@ -1517,8 +1430,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
                 throw wae;
             }
             if (manager.getContext().getLogger().isDebugEnabled()) {
-                manager.getContext().getLogger().debug("  loading attribute '" + name +
-                    "' with value '" + value + "'");
+                manager.getContext().getLogger().debug("  loading attribute '" + name + "' with value '" + value + "'");
             }
             // Handle the case where the filter configuration was changed while
             // the web application was stopped.
@@ -1526,7 +1438,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
                 continue;
             }
             // ConcurrentHashMap does not allow null keys or values
-            if(null != value) {
+            if (null != value) {
                 attributes.put(name, value);
             }
         }
@@ -1539,19 +1451,14 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Write a serialized version of this session object to the specified
-     * object output stream.
+     * Write a serialized version of this session object to the specified object output stream.
      * <p>
-     * <b>IMPLEMENTATION NOTE</b>:  The owning Manager will not be stored
-     * in the serialized representation of this Session.  After calling
-     * <code>readObject()</code>, you must set the associated Manager
-     * explicitly.
+     * <b>IMPLEMENTATION NOTE</b>: The owning Manager will not be stored in the serialized representation of this
+     * Session. After calling <code>readObject()</code>, you must set the associated Manager explicitly.
      * <p>
-     * <b>IMPLEMENTATION NOTE</b>:  Any attribute that is not Serializable
-     * will be unbound from the session, with appropriate actions if it
-     * implements HttpSessionBindingListener.  If you do not want any such
-     * attributes, be sure the <code>distributable</code> property of the
-     * associated Manager is set to <code>true</code>.
+     * <b>IMPLEMENTATION NOTE</b>: Any attribute that is not Serializable will be unbound from the session, with
+     * appropriate actions if it implements HttpSessionBindingListener. If you do not want any such attributes, be sure
+     * the <code>distributable</code> property of the associated Manager is set to <code>true</code>.
      *
      * @param stream The output stream to write to
      *
@@ -1568,8 +1475,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
         stream.writeObject(Long.valueOf(thisAccessedTime));
         stream.writeObject(id);
         if (manager.getContext().getLogger().isDebugEnabled()) {
-            manager.getContext().getLogger().debug
-                ("writeObject() storing session " + id);
+            manager.getContext().getLogger().debug("writeObject() storing session " + id);
         }
 
         // Gather authentication information (if configured)
@@ -1582,8 +1488,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
             sessionPrincipal = getPrincipal();
             if (!(sessionPrincipal instanceof Serializable)) {
                 sessionPrincipal = null;
-                manager.getContext().getLogger().warn(
-                        sm.getString("standardSession.principalNotSerializable", id));
+                manager.getContext().getLogger().warn(sm.getString("standardSession.principalNotSerializable", id));
             }
             expectedSessionId = (String) notes.get(org.apache.catalina.authenticator.Constants.SESSION_ID_NOTE);
             savedRequest = (SavedRequest) notes.get(org.apache.catalina.authenticator.Constants.FORM_REQUEST_NOTE);
@@ -1594,8 +1499,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
         try {
             stream.writeObject(sessionPrincipal);
         } catch (NotSerializableException e) {
-            manager.getContext().getLogger().warn(
-                    sm.getString("standardSession.principalNotSerializable", id), e);
+            manager.getContext().getLogger().warn(sm.getString("standardSession.principalNotSerializable", id), e);
         }
         stream.writeObject(expectedSessionId);
         stream.writeObject(savedRequest);
@@ -1628,8 +1532,8 @@ public class StandardSession implements HttpSession, Session, Serializable {
                             "  storing attribute '" + saveNames.get(i) + "' with value '" + saveValues.get(i) + "'");
                 }
             } catch (NotSerializableException e) {
-                manager.getContext().getLogger().warn(
-                        sm.getString("standardSession.notSerializable", saveNames.get(i), id), e);
+                manager.getContext().getLogger()
+                        .warn(sm.getString("standardSession.notSerializable", saveNames.get(i), id), e);
             }
         }
 
@@ -1638,8 +1542,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
     /**
      * Return whether authentication information shall be persisted or not.
      *
-     * @return {@code true}, if authentication information shall be persisted;
-     *         {@code false} otherwise
+     * @return {@code true}, if authentication information shall be persisted; {@code false} otherwise
      */
     private boolean getPersistAuthentication() {
         if (manager instanceof ManagerBase) {
@@ -1649,22 +1552,18 @@ public class StandardSession implements HttpSession, Session, Serializable {
     }
 
     /**
-     * Should the given session attribute be excluded? This implementation
-     * checks:
+     * Should the given session attribute be excluded? This implementation checks:
      * <ul>
      * <li>{@link Constants#excludedAttributeNames}</li>
      * <li>{@link Manager#willAttributeDistribute(String, Object)}</li>
      * </ul>
-     * Note: This method deliberately does not check
-     *       {@link #isAttributeDistributable(String, Object)} which is kept
-     *       separate to support the checks required in
-     *       {@link #setAttribute(String, Object, boolean)}
+     * Note: This method deliberately does not check {@link #isAttributeDistributable(String, Object)} which is kept
+     * separate to support the checks required in {@link #setAttribute(String, Object, boolean)}
      *
      * @param name  The attribute name
      * @param value The attribute value
      *
-     * @return {@code true} if the attribute should be excluded from
-     *         distribution, otherwise {@code false}
+     * @return {@code true} if the attribute should be excluded from distribution, otherwise {@code false}
      */
     protected boolean exclude(String name, Object value) {
         if (Constants.excludedAttributeNames.contains(name)) {
@@ -1687,9 +1586,8 @@ public class StandardSession implements HttpSession, Session, Serializable {
     // ------------------------------------------------------ Protected Methods
 
     /**
-     * Notify all session event listeners that a particular event has
-     * occurred for this Session.  The default implementation performs
-     * this notification synchronously using the calling thread.
+     * Notify all session event listeners that a particular event has occurred for this Session. The default
+     * implementation performs this notification synchronously using the calling thread.
      *
      * @param type Event type
      * @param data Event data
@@ -1712,9 +1610,8 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * @return the names of all currently defined session attributes
-     * as an array of Strings.  If there are no defined attributes, a
-     * zero-length array is returned.
+     * @return the names of all currently defined session attributes as an array of Strings. If there are no defined
+     *             attributes, a zero-length array is returned.
      */
     protected String[] keys() {
 
@@ -1724,17 +1621,14 @@ public class StandardSession implements HttpSession, Session, Serializable {
 
 
     /**
-     * Remove the object bound with the specified name from this session.  If
-     * the session does not have an object bound with this name, this method
-     * does nothing.
+     * Remove the object bound with the specified name from this session. If the session does not have an object bound
+     * with this name, this method does nothing.
      * <p>
-     * After this method executes, and if the object implements
-     * <code>HttpSessionBindingListener</code>, the container calls
-     * <code>valueUnbound()</code> on the object.
+     * After this method executes, and if the object implements <code>HttpSessionBindingListener</code>, the container
+     * calls <code>valueUnbound()</code> on the object.
      *
-     * @param name Name of the object to remove from this session.
-     * @param notify Should we notify interested listeners that this
-     *  attribute is being removed?
+     * @param name   Name of the object to remove from this session.
+     * @param notify Should we notify interested listeners that this attribute is being removed?
      */
     protected void removeAttributeInternal(String name, boolean notify) {
 
@@ -1789,8 +1683,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
     }
 
 
-    private static class PrivilegedNewSessionFacade implements
-            PrivilegedAction<StandardSessionFacade> {
+    private static class PrivilegedNewSessionFacade implements PrivilegedAction<StandardSessionFacade> {
 
         private final HttpSession session;
 
@@ -1799,7 +1692,7 @@ public class StandardSession implements HttpSession, Session, Serializable {
         }
 
         @Override
-        public StandardSessionFacade run(){
+        public StandardSessionFacade run() {
             return new StandardSessionFacade(session);
         }
     }
diff --git a/java/org/apache/catalina/session/StoreBase.java b/java/org/apache/catalina/session/StoreBase.java
index 3438d013b8..222864a6d6 100644
--- a/java/org/apache/catalina/session/StoreBase.java
+++ b/java/org/apache/catalina/session/StoreBase.java
@@ -33,8 +33,8 @@ import org.apache.catalina.util.ToStringUtil;
 import org.apache.tomcat.util.res.StringManager;
 
 /**
- * Abstract implementation of the {@link Store} interface to
- * support most of the functionality required by a {@link Store}.
+ * Abstract implementation of the {@link Store} interface to support most of the functionality required by a
+ * {@link Store}.
  *
  * @author Bip Thelin
  */
@@ -117,27 +117,24 @@ public abstract class StoreBase extends LifecycleBase implements Store {
     }
 
     /**
-     * Get only those keys of sessions, that are saved in the Store and are to
-     * be expired.
+     * Get only those keys of sessions, that are saved in the Store and are to be expired.
      *
      * @return list of session keys, that are to be expired
-     * @throws IOException
-     *             if an input-/output error occurred
+     *
+     * @throws IOException if an input-/output error occurred
      */
     public String[] expiredKeys() throws IOException {
         return keys();
     }
 
     /**
-     * Called by our background reaper thread to check if Sessions
-     * saved in our store are subject of being expired. If so expire
-     * the Session and remove it from the Store.
-     *
+     * Called by our background reaper thread to check if Sessions saved in our store are subject of being expired. If
+     * so expire the Session and remove it from the Store.
      */
     public void processExpires() {
         String[] keys = null;
 
-        if(!getState().isAvailable()) {
+        if (!getState().isAvailable()) {
             return;
         }
 
@@ -148,7 +145,8 @@ public abstract class StoreBase extends LifecycleBase implements Store {
             return;
         }
         if (manager.getContext().getLogger().isDebugEnabled()) {
-            manager.getContext().getLogger().debug(getStoreName()+ ": processExpires check number of " + keys.length + " sessions" );
+            manager.getContext().getLogger()
+                    .debug(getStoreName() + ": processExpires check number of " + keys.length + " sessions");
         }
 
         long timeNow = System.currentTimeMillis();
@@ -164,7 +162,8 @@ public abstract class StoreBase extends LifecycleBase implements Store {
                     continue;
                 }
                 if (manager.getContext().getLogger().isDebugEnabled()) {
-                    manager.getContext().getLogger().debug(getStoreName() + ": processExpires expire store session " + key);
+                    manager.getContext().getLogger()
+                            .debug(getStoreName() + ": processExpires expire store session " + key);
                 }
                 boolean isLoaded = false;
                 if (manager instanceof PersistentManagerBase) {
@@ -201,15 +200,12 @@ public abstract class StoreBase extends LifecycleBase implements Store {
     // --------------------------------------------------------- Protected Methods
 
     /**
-     * Create the object input stream to use to read a session from the store.
-     * Sub-classes <b>must</b> have set the thread context class loader before
-     * calling this method.
+     * Create the object input stream to use to read a session from the store. Sub-classes <b>must</b> have set the
+     * thread context class loader before calling this method.
      *
-     * @param is The input stream provided by the sub-class that will provide
-     *           the data for a session
+     * @param is The input stream provided by the sub-class that will provide the data for a session
      *
-     * @return An appropriately configured ObjectInputStream from which the
-     *         session can be read.
+     * @return An appropriately configured ObjectInputStream from which the session can be read.
      *
      * @throws IOException if a problem occurs creating the ObjectInputStream
      */
@@ -239,11 +235,10 @@ public abstract class StoreBase extends LifecycleBase implements Store {
 
 
     /**
-     * Start this component and implement the requirements
-     * of {@link LifecycleBase#startInternal()}.
+     * Start this component and implement the requirements of {@link LifecycleBase#startInternal()}.
      *
-     * @exception LifecycleException if this component detects a fatal error
-     *  that prevents this component from being used
+     * @exception LifecycleException if this component detects a fatal error that prevents this component from being
+     *                                   used
      */
     @Override
     protected synchronized void startInternal() throws LifecycleException {
@@ -253,11 +248,10 @@ public abstract class StoreBase extends LifecycleBase implements Store {
 
 
     /**
-     * Stop this component and implement the requirements
-     * of {@link LifecycleBase#stopInternal()}.
+     * Stop this component and implement the requirements of {@link LifecycleBase#stopInternal()}.
      *
-     * @exception LifecycleException if this component detects a fatal error
-     *  that prevents this component from being used
+     * @exception LifecycleException if this component detects a fatal error that prevents this component from being
+     *                                   used
      */
     @Override
     protected synchronized void stopInternal() throws LifecycleException {
diff --git a/java/org/apache/catalina/session/TooManyActiveSessionsException.java b/java/org/apache/catalina/session/TooManyActiveSessionsException.java
index 33d8e15aea..25e23fd234 100644
--- a/java/org/apache/catalina/session/TooManyActiveSessionsException.java
+++ b/java/org/apache/catalina/session/TooManyActiveSessionsException.java
@@ -17,8 +17,8 @@
 package org.apache.catalina.session;
 
 /**
- * An exception that indicates the maximum number of active sessions has been
- * reached and the server is refusing to create any new sessions.
+ * An exception that indicates the maximum number of active sessions has been reached and the server is refusing to
+ * create any new sessions.
  */
 public class TooManyActiveSessionsException extends IllegalStateException {
 
@@ -32,9 +32,8 @@ public class TooManyActiveSessionsException extends IllegalStateException {
     /**
      * Creates a new TooManyActiveSessionsException.
      *
-     * @param message A description for the exception.
-     * @param maxActive The maximum number of active sessions allowed by the
-     *                  session manager.
+     * @param message   A description for the exception.
+     * @param maxActive The maximum number of active sessions allowed by the session manager.
      */
     public TooManyActiveSessionsException(String message, int maxActive) {
         super(message);


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org