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

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


The following commit(s) were added to refs/heads/main by this push:
     new f18f1c8e41 Remove deprecated code
f18f1c8e41 is described below

commit f18f1c8e4105afa2be8264a3f8a8bfc589589d33
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Aug 27 12:35:36 2025 +0100

    Remove deprecated code
---
 java/org/apache/catalina/WebResourceLockSet.java   | 67 ----------------------
 .../catalina/webresources/DirResourceSet.java      | 33 -----------
 2 files changed, 100 deletions(-)

diff --git a/java/org/apache/catalina/WebResourceLockSet.java 
b/java/org/apache/catalina/WebResourceLockSet.java
index e6620561c3..bd80c85b1d 100644
--- a/java/org/apache/catalina/WebResourceLockSet.java
+++ b/java/org/apache/catalina/WebResourceLockSet.java
@@ -16,9 +16,7 @@
  */
 package org.apache.catalina;
 
-import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 /**
  * Interface implemented by {@link WebResourceSet} implementations that wish 
to provide locking functionality.
@@ -35,69 +33,4 @@ public interface WebResourceLockSet {
      * @return A reentrant read/write lock for the given resource.
      */
     ReadWriteLock getLock(String path);
-
-    /**
-     * Lock the resource at the provided path for reading. The resource is not 
required to exist. Read locks are not
-     * exclusive.
-     *
-     * @param path The path to the resource to be locked for reading
-     *
-     * @return The {@link ResourceLock} that must be passed to {@link 
#unlockForRead(ResourceLock)} to release the lock
-     *
-     * @deprecated Unused. Will be removed in Tomcat 12 onwards. Use {@code 
#getLock(String)} instead.
-     */
-    @Deprecated
-    ResourceLock lockForRead(String path);
-
-    /**
-     * Release a read lock from the resource associated with the given {@link 
ResourceLock}.
-     *
-     * @param resourceLock The {@link ResourceLock} associated with the 
resource for which a read lock should be
-     *                         released
-     *
-     * @deprecated Unused. Will be removed in Tomcat 12 onwards. Use {@code 
#getLock(String)} instead.
-     */
-    @Deprecated
-    void unlockForRead(ResourceLock resourceLock);
-
-    /**
-     * Lock the resource at the provided path for writing. The resource is not 
required to exist. Write locks are
-     * exclusive.
-     *
-     * @param path The path to the resource to be locked for writing
-     *
-     * @return The {@link ResourceLock} that must be passed to {@link 
#unlockForWrite(ResourceLock)} to release the lock
-     *
-     * @deprecated Unused. Will be removed in Tomcat 12 onwards. Use {@code 
#getLock(String)} instead.
-     */
-    @Deprecated
-    ResourceLock lockForWrite(String path);
-
-    /**
-     * Release the write lock from the resource associated with the given 
{@link ResourceLock}.
-     *
-     * @param resourceLock The {@link ResourceLock} associated with the 
resource for which the write lock should be
-     *                         released
-     *
-     * @deprecated Unused. Will be removed in Tomcat 12 onwards. Use {@code 
#getLock(String)} instead.
-     */
-    @Deprecated
-    void unlockForWrite(ResourceLock resourceLock);
-
-
-    /**
-     * Represents a lock on a resource.
-     *
-     * @deprecated Unused. Will be removed in Tomcat 12 onwards.
-     */
-    @Deprecated
-    class ResourceLock {
-        public final AtomicInteger count = new AtomicInteger(0);
-        public final ReentrantReadWriteLock reentrantLock = new 
ReentrantReadWriteLock();
-        public final String key;
-
-        public ResourceLock(String key) {
-            this.key = key;
-        }
-    }
 }
diff --git a/java/org/apache/catalina/webresources/DirResourceSet.java 
b/java/org/apache/catalina/webresources/DirResourceSet.java
index 5b51775007..08ddc26206 100644
--- a/java/org/apache/catalina/webresources/DirResourceSet.java
+++ b/java/org/apache/catalina/webresources/DirResourceSet.java
@@ -352,42 +352,9 @@ public class DirResourceSet extends 
AbstractFileResourceSet implements WebResour
     }
 
 
-
     @Override
     public ReadWriteLock getLock(String path) {
         String key = getLockKey(path);
         return resourceLocksByPath.getLock(key);
     }
-
-
-    @SuppressWarnings("deprecation")
-    @Override
-    public ResourceLock lockForRead(String path) {
-        String key = getLockKey(path);
-        resourceLocksByPath.getLock(key).readLock().lock();
-        return new ResourceLock(key);
-    }
-
-
-    @SuppressWarnings("deprecation")
-    @Override
-    public void unlockForRead(ResourceLock resourceLock) {
-        resourceLocksByPath.getLock(resourceLock.key).readLock().unlock();
-    }
-
-
-    @SuppressWarnings("deprecation")
-    @Override
-    public ResourceLock lockForWrite(String path) {
-        String key = getLockKey(path);
-        resourceLocksByPath.getLock(key).writeLock().lock();
-        return new ResourceLock(key);
-    }
-
-
-    @SuppressWarnings("deprecation")
-    @Override
-    public void unlockForWrite(ResourceLock resourceLock) {
-        resourceLocksByPath.getLock(resourceLock.key).writeLock().unlock();
-    }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to