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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
     new ee49341f39 Sync in needed to iterate safely over 
Collections.synchronizedList
ee49341f39 is described below

commit ee49341f39ebd85d3babad46d0d0239d38bc4a46
Author: remm <r...@apache.org>
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 b184cf2368..cd9d6a24d7 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -217,7 +217,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<>();
 
 
     /**
@@ -227,13 +227,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: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to