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

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


The following commit(s) were added to refs/heads/master by this push:
     new 51a2e60  Delete some deprecated code planned for removal in Tomcat 10
51a2e60 is described below

commit 51a2e6013ed9f9ce4366cfefb4246e57dd9c6797
Author: remm <r...@apache.org>
AuthorDate: Wed Jan 15 11:14:19 2020 +0100

    Delete some deprecated code planned for removal in Tomcat 10
    
    noCompressionStrongETag is now set to true.
---
 java/org/apache/coyote/CompressionConfig.java      | 42 +++-------------------
 .../coyote/http11/AbstractHttp11Protocol.java      | 10 ------
 java/org/apache/coyote/http2/Http2Protocol.java    | 10 ------
 test/org/apache/coyote/TestCompressionConfig.java  | 27 ++++++--------
 4 files changed, 15 insertions(+), 74 deletions(-)

diff --git a/java/org/apache/coyote/CompressionConfig.java 
b/java/org/apache/coyote/CompressionConfig.java
index 5d26c88..b2b2e2a 100644
--- a/java/org/apache/coyote/CompressionConfig.java
+++ b/java/org/apache/coyote/CompressionConfig.java
@@ -46,7 +46,6 @@ public class CompressionConfig {
             
"text/javascript,application/javascript,application/json,application/xml";
     private String[] compressibleMimeTypes = null;
     private int compressionMinSize = 2048;
-    private boolean noCompressionStrongETag = true;
 
 
     /**
@@ -184,35 +183,6 @@ public class CompressionConfig {
 
 
     /**
-     * Determine if compression is disabled if the resource has a strong ETag.
-     *
-     * @return {@code true} if compression is disabled, otherwise {@code false}
-     *
-     * @deprecated Will be removed in Tomcat 10 where it will be hard-coded to
-     *             {@code true}
-     */
-    @Deprecated
-    public boolean getNoCompressionStrongETag() {
-        return noCompressionStrongETag;
-    }
-
-
-    /**
-     * Set whether compression is disabled for resources with a strong ETag.
-     *
-     * @param noCompressionStrongETag {@code true} if compression is disabled,
-     *                                otherwise {@code false}
-     *
-     * @deprecated Will be removed in Tomcat 10 where it will be hard-coded to
-     *             {@code true}
-     */
-    @Deprecated
-    public void setNoCompressionStrongETag(boolean noCompressionStrongETag) {
-        this.noCompressionStrongETag = noCompressionStrongETag;
-    }
-
-
-    /**
      * Determines if compression should be enabled for the given response and 
if
      * it is, sets any necessary headers to mark it as such.
      *
@@ -266,13 +236,11 @@ public class CompressionConfig {
         }
 
         // Check if the resource has a strong ETag
-        if (noCompressionStrongETag) {
-            String eTag = responseHeaders.getHeader("ETag");
-            if (eTag != null && !eTag.trim().startsWith("W/")) {
-                // Has an ETag that doesn't start with "W/..." so it must be a
-                // strong ETag
-                return false;
-            }
+        String eTag = responseHeaders.getHeader("ETag");
+        if (eTag != null && !eTag.trim().startsWith("W/")) {
+            // Has an ETag that doesn't start with "W/..." so it must be a
+            // strong ETag
+            return false;
         }
 
         // If processing reaches this far, the response might be compressed.
diff --git a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java 
b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
index 3f02a12..c40e1b3 100644
--- a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
+++ b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
@@ -279,16 +279,6 @@ public abstract class AbstractHttp11Protocol<S> extends 
AbstractProtocol<S> {
     }
 
 
-    @Deprecated
-    public boolean getNoCompressionStrongETag() {
-        return compressionConfig.getNoCompressionStrongETag();
-    }
-    @Deprecated
-    public void setNoCompressionStrongETag(boolean noCompressionStrongETag) {
-        compressionConfig.setNoCompressionStrongETag(noCompressionStrongETag);
-    }
-
-
     public boolean useCompression(Request request, Response response) {
         return compressionConfig.useCompression(request, response);
     }
diff --git a/java/org/apache/coyote/http2/Http2Protocol.java 
b/java/org/apache/coyote/http2/Http2Protocol.java
index ed23505..aab980c 100644
--- a/java/org/apache/coyote/http2/Http2Protocol.java
+++ b/java/org/apache/coyote/http2/Http2Protocol.java
@@ -408,16 +408,6 @@ public class Http2Protocol implements UpgradeProtocol {
     }
 
 
-    @Deprecated
-    public boolean getNoCompressionStrongETag() {
-        return compressionConfig.getNoCompressionStrongETag();
-    }
-    @Deprecated
-    public void setNoCompressionStrongETag(boolean noCompressionStrongETag) {
-        compressionConfig.setNoCompressionStrongETag(noCompressionStrongETag);
-    }
-
-
     public boolean useCompression(Request request, Response response) {
         return compressionConfig.useCompression(request, response);
     }
diff --git a/test/org/apache/coyote/TestCompressionConfig.java 
b/test/org/apache/coyote/TestCompressionConfig.java
index 71b1c00..b266c7a 100644
--- a/test/org/apache/coyote/TestCompressionConfig.java
+++ b/test/org/apache/coyote/TestCompressionConfig.java
@@ -29,24 +29,20 @@ import org.junit.runners.Parameterized.Parameter;
 @RunWith(Parameterized.class)
 public class TestCompressionConfig {
 
-    @Parameterized.Parameters(name = "{index}: accept-encoding[{0}], ETag 
[{1}], NoCompressionStrongETag[{2}], compress[{3}]")
+    @Parameterized.Parameters(name = "{index}: accept-encoding[{0}], ETag 
[{1}], compress[{2}]")
     public static Collection<Object[]> parameters() {
         List<Object[]> parameterSets = new ArrayList<>();
 
-        parameterSets.add(new Object[] { new String[] {  },              null, 
Boolean.TRUE,  Boolean.FALSE });
-        parameterSets.add(new Object[] { new String[] { "gzip" },        null, 
Boolean.TRUE,  Boolean.TRUE });
-        parameterSets.add(new Object[] { new String[] { "xgzip" },       null, 
Boolean.TRUE,  Boolean.FALSE });
-        parameterSets.add(new Object[] { new String[] { "<>gzip" },      null, 
Boolean.TRUE,  Boolean.FALSE });
-        parameterSets.add(new Object[] { new String[] { "foo", "gzip" }, null, 
Boolean.TRUE,  Boolean.TRUE });
-        parameterSets.add(new Object[] { new String[] { "<>", "gzip" },  null, 
Boolean.TRUE,  Boolean.TRUE });
+        parameterSets.add(new Object[] { new String[] {  },              null, 
Boolean.FALSE });
+        parameterSets.add(new Object[] { new String[] { "gzip" },        null, 
Boolean.TRUE });
+        parameterSets.add(new Object[] { new String[] { "xgzip" },       null, 
Boolean.FALSE });
+        parameterSets.add(new Object[] { new String[] { "<>gzip" },      null, 
Boolean.FALSE });
+        parameterSets.add(new Object[] { new String[] { "foo", "gzip" }, null, 
Boolean.TRUE });
+        parameterSets.add(new Object[] { new String[] { "<>", "gzip" },  null, 
Boolean.TRUE });
 
-        parameterSets.add(new Object[] { new String[] { "gzip" },        null, 
Boolean.TRUE,  Boolean.TRUE });
-        parameterSets.add(new Object[] { new String[] { "gzip" },        "W/", 
Boolean.TRUE,  Boolean.TRUE });
-        parameterSets.add(new Object[] { new String[] { "gzip" },        "XX", 
Boolean.TRUE,  Boolean.FALSE });
-
-        parameterSets.add(new Object[] { new String[] { "gzip" },        null, 
Boolean.FALSE, Boolean.TRUE });
-        parameterSets.add(new Object[] { new String[] { "gzip" },        "W/", 
Boolean.FALSE, Boolean.TRUE });
-        parameterSets.add(new Object[] { new String[] { "gzip" },        "XX", 
Boolean.FALSE, Boolean.TRUE });
+        parameterSets.add(new Object[] { new String[] { "gzip" },        null, 
Boolean.TRUE });
+        parameterSets.add(new Object[] { new String[] { "gzip" },        "W/", 
Boolean.TRUE });
+        parameterSets.add(new Object[] { new String[] { "gzip" },        "XX", 
Boolean.FALSE });
 
         return parameterSets;
     }
@@ -56,8 +52,6 @@ public class TestCompressionConfig {
     @Parameter(1)
     public String eTag;
     @Parameter(2)
-    public Boolean noCompressionStrongETag;
-    @Parameter(3)
     public Boolean compress;
 
     @SuppressWarnings("deprecation")
@@ -67,7 +61,6 @@ public class TestCompressionConfig {
         CompressionConfig compressionConfig = new CompressionConfig();
         // Skip length and MIME type checks
         compressionConfig.setCompression("force");
-        
compressionConfig.setNoCompressionStrongETag(noCompressionStrongETag.booleanValue());
 
         Request request = new Request();
         Response response = new Response();


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

Reply via email to