This is an automated email from the ASF dual-hosted git repository.
remm 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 980f6a88b2 Sync in needed to iterate safely over
Collections.synchronizedList
980f6a88b2 is described below
commit 980f6a88b24e203c2450e5aa6476ee7614d08444
Author: remm <[email protected]>
AuthorDate: Tue Sep 3 11:35:37 2024 +0200
Sync in needed to iterate safely over Collections.synchronizedList
As a result it is likely simpler to use CopyOnWriteArrayList instead.
Also make types more explicit (see if it makes Coverity happier).
---
java/org/apache/catalina/servlets/WebdavServlet.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java
b/java/org/apache/catalina/servlets/WebdavServlet.java
index 60076f8b27..f3280fde49 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -218,7 +218,7 @@ public class WebdavServlet extends DefaultServlet
implements PeriodicEventListen
* Key : path <br>
* Value : LockInfo
*/
- private final Map<String,LockInfo> resourceLocks = new
ConcurrentHashMap<>();
+ private final ConcurrentHashMap<String,LockInfo> resourceLocks = new
ConcurrentHashMap<>();
/**
@@ -228,13 +228,13 @@ public class WebdavServlet extends DefaultServlet
implements PeriodicEventListen
* Value : List of lock-null resource which are members of the collection.
Each element of the List is the path
* associated with the lock-null resource.
*/
- private final Map<String,List<String>> lockNullResources = new
ConcurrentHashMap<>();
+ private final ConcurrentHashMap<String,CopyOnWriteArrayList<String>>
lockNullResources = new ConcurrentHashMap<>();
/**
* List of the inheritable collection locks.
*/
- private final List<LockInfo> collectionLocks =
Collections.synchronizedList(new ArrayList<>());
+ private final CopyOnWriteArrayList<LockInfo> collectionLocks = new
CopyOnWriteArrayList<>();
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]