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 7c329c409b Remove deprecated code
7c329c409b is described below

commit 7c329c409b3bc0c51c2493e38678d46d4ec4f728
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Oct 31 09:02:45 2022 +0000

    Remove deprecated code
---
 java/org/apache/catalina/Context.java              | 22 ------------------
 java/org/apache/catalina/core/StandardContext.java | 18 ---------------
 .../apache/catalina/core/mbeans-descriptors.xml    |  4 ----
 .../org/apache/catalina/startup/FailedContext.java |  7 ------
 .../webresources/AbstractArchiveResourceSet.java   |  4 +---
 .../TestAbstractArchiveResourceSet.java            | 26 ----------------------
 test/org/apache/tomcat/unittest/TesterContext.java | 12 ----------
 webapps/docs/config/context.xml                    | 10 ---------
 8 files changed, 1 insertion(+), 102 deletions(-)

diff --git a/java/org/apache/catalina/Context.java 
b/java/org/apache/catalina/Context.java
index 1ac36ee92e..cf940fad3f 100644
--- a/java/org/apache/catalina/Context.java
+++ b/java/org/apache/catalina/Context.java
@@ -1943,26 +1943,4 @@ public interface Context extends Container, ContextBind {
      * @param dispatcherWrapsSameObject the new flag value
      */
     public void setDispatcherWrapsSameObject(boolean 
dispatcherWrapsSameObject);
-
-
-    /**
-     * @return <code>true</code> if the resources archive lookup will
-     * use a bloom filter.
-     *
-     * @deprecated This method will be removed in Tomcat 11 onwards.
-     *             Use {@link WebResourceRoot#getArchiveIndexStrategy()}
-     */
-    @Deprecated
-    public boolean getUseBloomFilterForArchives();
-
-    /**
-     * Set bloom filter flag value.
-     *
-     * @param useBloomFilterForArchives The new fast class path scan flag
-     *
-     * @deprecated This method will be removed in Tomcat 11 onwards
-     *             Use {@link WebResourceRoot#setArchiveIndexStrategy(String)}
-     */
-    @Deprecated
-    public void setUseBloomFilterForArchives(boolean 
useBloomFilterForArchives);
 }
diff --git a/java/org/apache/catalina/core/StandardContext.java 
b/java/org/apache/catalina/core/StandardContext.java
index caeb3b2514..d21ea4fed5 100644
--- a/java/org/apache/catalina/core/StandardContext.java
+++ b/java/org/apache/catalina/core/StandardContext.java
@@ -835,7 +835,6 @@ public class StandardContext extends ContainerBase
 
     private boolean parallelAnnotationScanning = false;
 
-    private boolean useBloomFilterForArchives = false;
 
     // ----------------------------------------------------- Context Properties
 
@@ -1452,23 +1451,6 @@ public class StandardContext extends ContainerBase
     }
 
 
-    @Override
-    @Deprecated
-    public boolean getUseBloomFilterForArchives() {
-        return this.useBloomFilterForArchives;
-    }
-
-
-    @Override
-    @Deprecated
-    public void setUseBloomFilterForArchives(boolean 
useBloomFilterForArchives) {
-        boolean oldUseBloomFilterForArchives = this.useBloomFilterForArchives;
-        this.useBloomFilterForArchives = useBloomFilterForArchives;
-        support.firePropertyChange("useBloomFilterForArchives", 
oldUseBloomFilterForArchives,
-                this.useBloomFilterForArchives);
-    }
-
-
     @Override
     public void setParallelAnnotationScanning(boolean 
parallelAnnotationScanning) {
 
diff --git a/java/org/apache/catalina/core/mbeans-descriptors.xml 
b/java/org/apache/catalina/core/mbeans-descriptors.xml
index 92f9f9d434..ba1d0facb7 100644
--- a/java/org/apache/catalina/core/mbeans-descriptors.xml
+++ b/java/org/apache/catalina/core/mbeans-descriptors.xml
@@ -321,10 +321,6 @@
                description="Unpack WAR property"
                type="boolean"/>
 
-    <attribute name="useBloomFilterForArchives"
-               description="DEPRECATED: Use a bloom filter for archives 
lookups"
-               type="boolean"/>
-
     <attribute name="useHttpOnly"
                description="Indicates that session cookies should use HttpOnly"
                type="boolean"/>
diff --git a/java/org/apache/catalina/startup/FailedContext.java 
b/java/org/apache/catalina/startup/FailedContext.java
index e352ce28c7..3234eed0cd 100644
--- a/java/org/apache/catalina/startup/FailedContext.java
+++ b/java/org/apache/catalina/startup/FailedContext.java
@@ -835,11 +835,4 @@ public class FailedContext extends LifecycleMBeanBase 
implements Context {
     public boolean getParallelAnnotationScanning() { return false; }
     @Override
     public void setParallelAnnotationScanning(boolean 
parallelAnnotationScanning) {}
-
-    @Override
-    public boolean getUseBloomFilterForArchives() { return false; }
-
-    @Override
-    public void setUseBloomFilterForArchives(boolean 
useBloomFilterForArchives) {}
-
 }
\ No newline at end of file
diff --git 
a/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java 
b/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java
index 3933cb3ab1..9d22a7d1b0 100644
--- a/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java
+++ b/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java
@@ -309,14 +309,12 @@ public abstract class AbstractArchiveResourceSet extends 
AbstractResourceSet {
                 sm.getString("abstractArchiveResourceSet.setReadOnlyFalse"));
     }
 
-    @SuppressWarnings("deprecation")
     protected JarFile openJarFile() throws IOException {
         synchronized (archiveLock) {
             if (archive == null) {
                 archive = new JarFile(new File(getBase()), true, 
ZipFile.OPEN_READ, Runtime.version());
                 WebResourceRoot root = getRoot();
-                if (root.getArchiveIndexStrategyEnum().getUsesBloom() ||
-                        root.getContext() != null && 
root.getContext().getUseBloomFilterForArchives()) {
+                if (root.getArchiveIndexStrategyEnum().getUsesBloom()) {
                     jarContents = new JarContents(archive);
                     retainBloomFilterForArchives = 
root.getArchiveIndexStrategyEnum().getRetain();
                 }
diff --git 
a/test/org/apache/catalina/webresources/TestAbstractArchiveResourceSet.java 
b/test/org/apache/catalina/webresources/TestAbstractArchiveResourceSet.java
index ba5f742d65..acaff361d5 100644
--- a/test/org/apache/catalina/webresources/TestAbstractArchiveResourceSet.java
+++ b/test/org/apache/catalina/webresources/TestAbstractArchiveResourceSet.java
@@ -78,32 +78,6 @@ public class TestAbstractArchiveResourceSet {
         Assert.assertNull(getJarContents(jarResourceSet));
     }
 
-    @Deprecated
-    @Test
-    public void testBloomFilterWithSimpleArchiveIndexing() throws Exception {
-        WebResourceRoot root = new TesterWebResourceRoot();
-
-        
root.setArchiveIndexStrategy(WebResourceRoot.ArchiveIndexStrategy.SIMPLE.name());
-        root.getContext().setUseBloomFilterForArchives(true);
-
-        File file = new 
File("webapps/examples/WEB-INF/lib/taglibs-standard-impl-1.2.5-migrated-0.0.1.jar");
-
-        JarResourceSet jarResourceSet = new JarResourceSet(root, 
"/WEB-INF/classes", file.getAbsolutePath(), "/");
-        jarResourceSet.getArchiveEntries(false);
-        Assert.assertNotNull(getJarContents(jarResourceSet));
-
-        WebResource r1 = jarResourceSet.getResource("/WEB-INF/classes/org/");
-        Assert.assertTrue(r1.isDirectory());
-        Assert.assertNotNull(getJarContents(jarResourceSet));
-
-        WebResource r2 = jarResourceSet.getResource("/WEB-INF/classes/org");
-        Assert.assertTrue(r2.isDirectory());
-        Assert.assertNotNull(getJarContents(jarResourceSet));
-
-        jarResourceSet.gc();
-        Assert.assertNull(getJarContents(jarResourceSet));
-    }
-
     private JarContents getJarContents(Object target)
         throws IllegalArgumentException, IllegalAccessException, 
NoSuchFieldException, SecurityException {
         Field field = 
AbstractArchiveResourceSet.class.getDeclaredField("jarContents");
diff --git a/test/org/apache/tomcat/unittest/TesterContext.java 
b/test/org/apache/tomcat/unittest/TesterContext.java
index b0c624b951..8ee05598c7 100644
--- a/test/org/apache/tomcat/unittest/TesterContext.java
+++ b/test/org/apache/tomcat/unittest/TesterContext.java
@@ -1305,16 +1305,4 @@ public class TesterContext implements Context {
     public boolean getParallelAnnotationScanning() { return false; }
     @Override
     public void setParallelAnnotationScanning(boolean 
parallelAnnotationScanning) {}
-
-    boolean useBloomFilterForArchives = false;
-    @Override
-    public boolean getUseBloomFilterForArchives() {
-        return useBloomFilterForArchives;
-    }
-
-    @Override
-    public void setUseBloomFilterForArchives(boolean 
useBloomFilterForArchives) {
-        this.useBloomFilterForArchives = useBloomFilterForArchives;
-    }
-
 }
diff --git a/webapps/docs/config/context.xml b/webapps/docs/config/context.xml
index e804c8c240..fa4ec3599f 100644
--- a/webapps/docs/config/context.xml
+++ b/webapps/docs/config/context.xml
@@ -638,16 +638,6 @@
         penalty.</p>
       </attribute>
 
-      <attribute name="useBloomFilterForArchives" required="false">
-        <p>DEPRECATED: If this is <code>true</code> then a bloom filter will be
-        used to speed up archive lookups. This can be beneficial to the 
deployment
-        speed to web applications that contain very large amount of JARs.</p>
-        <p>If not specified, the default value of <code>false</code> will be
-        used.</p>
-        <p>This value can be overridden by archiveIndexStrategy in
-        <a href="resources.html">Resources</a></p>
-      </attribute>
-
       <attribute name="useHttpOnly" required="false">
        <p>Should the HttpOnly flag be set on session cookies to prevent client
           side script from accessing the session ID? Defaults to


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

Reply via email to