This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push:
new 60e3761117 Keep directory and directoryFile in sync
60e3761117 is described below
commit 60e376111704205b1eb42e560b37e2ffa63c4a79
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Oct 14 07:58:33 2025 +0100
Keep directory and directoryFile in sync
Reported by Coverity Scan but unlikely to be an issue in real usage as
configuration won't be changing at runtime (else all the sessions in the
store would be lost)
---
java/org/apache/catalina/session/FileStore.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/java/org/apache/catalina/session/FileStore.java
b/java/org/apache/catalina/session/FileStore.java
index 5685229cdd..9d21d2547e 100644
--- a/java/org/apache/catalina/session/FileStore.java
+++ b/java/org/apache/catalina/session/FileStore.java
@@ -61,7 +61,7 @@ public final class FileStore extends StoreBase {
* 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 = ".";
+ private volatile String directory = ".";
/**
@@ -98,7 +98,7 @@ public final class FileStore extends StoreBase {
*
* @param path The new directory path
*/
- public void setDirectory(String path) {
+ public synchronized void setDirectory(String path) {
String oldDirectory = this.directory;
this.directory = path;
this.directoryFile = null;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]