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 48c122b85b Remove deprecated code marked for removal in Tomcat 12 or 
earlier
48c122b85b is described below

commit 48c122b85b4384350163896b0bbe7e54b883ab5d
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Mar 20 13:29:46 2025 +0000

    Remove deprecated code marked for removal in Tomcat 12 or earlier
---
 java/org/apache/catalina/connector/Request.java    |  2 -
 .../apache/catalina/ha/session/DeltaSession.java   | 12 -----
 .../catalina/loader/WebappClassLoaderBase.java     |  6 ---
 java/org/apache/catalina/util/TLSUtil.java         |  4 +-
 java/org/apache/coyote/AbstractProcessor.java      |  2 -
 java/org/apache/coyote/Request.java                | 54 ----------------------
 java/org/apache/coyote/Response.java               | 47 -------------------
 java/org/apache/coyote/ajp/AjpProcessor.java       |  2 -
 java/org/apache/juli/WebappProperties.java         | 12 -----
 java/org/apache/tomcat/util/buf/AbstractChunk.java | 23 ---------
 .../org/apache/tomcat/util/http/parser/Cookie.java | 16 -------
 java/org/apache/tomcat/util/net/SSLSupport.java    | 10 ----
 .../org/apache/juli/TestClassLoaderLogManager.java |  5 --
 13 files changed, 1 insertion(+), 194 deletions(-)

diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index a7bea9198f..c0b12a95b5 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -853,7 +853,6 @@ public class Request implements HttpServletRequest {
 
     // ------------------------------------------------- ServletRequest Methods
 
-    @SuppressWarnings("deprecation")
     @Override
     public Object getAttribute(String name) {
         // Special attributes
@@ -881,7 +880,6 @@ public class Request implements HttpServletRequest {
             attr = coyoteRequest.getAttribute(Globals.SECURE_PROTOCOL_ATTR);
             if (attr != null) {
                 attributes.put(Globals.SECURE_PROTOCOL_ATTR, attr);
-                attributes.put(SSLSupport.PROTOCOL_VERSION_KEY, attr);
             }
             attr = coyoteRequest.getAttribute(Globals.CIPHER_SUITE_ATTR);
             if (attr != null) {
diff --git a/java/org/apache/catalina/ha/session/DeltaSession.java 
b/java/org/apache/catalina/ha/session/DeltaSession.java
index e73012479f..60f7a46b66 100644
--- a/java/org/apache/catalina/ha/session/DeltaSession.java
+++ b/java/org/apache/catalina/ha/session/DeltaSession.java
@@ -534,18 +534,6 @@ public class DeltaSession extends StandardSession 
implements Externalizable, Clu
         }
     }
 
-    /**
-     * Get the request.
-     *
-     * @return the request
-     *
-     * @deprecated Unused. This method will be removed in Tomcat 12.
-     */
-    @Deprecated
-    public DeltaRequest getDeltaRequest() {
-        return deltaRequest;
-    }
-
     /**
      * Replace the existing deltaRequest with the provided replacement.
      *
diff --git a/java/org/apache/catalina/loader/WebappClassLoaderBase.java 
b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
index e629c996af..3685b17aae 100644
--- a/java/org/apache/catalina/loader/WebappClassLoaderBase.java
+++ b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
@@ -2362,12 +2362,6 @@ public abstract class WebappClassLoaderBase extends 
URLClassLoader
     }
 
 
-    @Override
-    public boolean hasLoggingConfig() {
-        return findResource("logging.properties") != null;
-    }
-
-
     private static class CombinedEnumeration implements Enumeration<URL> {
 
         private final Enumeration<URL>[] sources;
diff --git a/java/org/apache/catalina/util/TLSUtil.java 
b/java/org/apache/catalina/util/TLSUtil.java
index f0c13a9aef..9839c1f734 100644
--- a/java/org/apache/catalina/util/TLSUtil.java
+++ b/java/org/apache/catalina/util/TLSUtil.java
@@ -30,13 +30,11 @@ public class TLSUtil {
      *
      * @return {@code true} if the attribute is used to pass TLS configuration 
information, otherwise {@code false}
      */
-    @SuppressWarnings("deprecation")
     public static boolean isTLSRequestAttribute(String name) {
         return switch (name) {
             case Globals.CERTIFICATES_ATTR, Globals.SECURE_PROTOCOL_ATTR, 
Globals.CIPHER_SUITE_ATTR,
                  Globals.KEY_SIZE_ATTR, Globals.SSL_SESSION_ID_ATTR, 
Globals.SSL_SESSION_MGR_ATTR,
-                 SSLSupport.PROTOCOL_VERSION_KEY, 
SSLSupport.REQUESTED_PROTOCOL_VERSIONS_KEY,
-                 SSLSupport.REQUESTED_CIPHERS_KEY -> true;
+                 SSLSupport.REQUESTED_PROTOCOL_VERSIONS_KEY, 
SSLSupport.REQUESTED_CIPHERS_KEY -> true;
             default -> false;
         };
     }
diff --git a/java/org/apache/coyote/AbstractProcessor.java 
b/java/org/apache/coyote/AbstractProcessor.java
index e493d16764..425b0dfd4f 100644
--- a/java/org/apache/coyote/AbstractProcessor.java
+++ b/java/org/apache/coyote/AbstractProcessor.java
@@ -818,14 +818,12 @@ public abstract class AbstractProcessor extends 
AbstractProcessorLight implement
      * Populate the TLS related request attributes from the {@link SSLSupport} 
instance associated with this processor.
      * Protocols that populate TLS attributes from a different source (e.g. 
AJP) should override this method.
      */
-    @SuppressWarnings("deprecation")
     protected void populateSslRequestAttributes() {
         try {
             if (sslSupport != null) {
                 Object sslO = sslSupport.getProtocol();
                 if (sslO != null) {
                     request.setAttribute(SSLSupport.SECURE_PROTOCOL_KEY, sslO);
-                    request.setAttribute(SSLSupport.PROTOCOL_VERSION_KEY, 
sslO);
                 }
                 sslO = sslSupport.getCipherSuite();
                 if (sslO != null) {
diff --git a/java/org/apache/coyote/Request.java 
b/java/org/apache/coyote/Request.java
index d5a944bc43..e2870bf06e 100644
--- a/java/org/apache/coyote/Request.java
+++ b/java/org/apache/coyote/Request.java
@@ -18,8 +18,6 @@ package org.apache.coyote;
 
 import java.io.IOException;
 import java.io.StringReader;
-import java.io.UnsupportedEncodingException;
-import java.nio.charset.Charset;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Objects;
@@ -390,58 +388,6 @@ public final class Request {
 
     // -------------------- encoding/type --------------------
 
-    /**
-     * Get the character encoding used for this request.
-     *
-     * @return The value set via {@link #setCharset(Charset)} or if no call 
has been made to that method try to obtain
-     *             if from the content type.
-     *
-     * @deprecated Unused. This method will be removed in Tomcat 12.
-     */
-    @Deprecated
-    public String getCharacterEncoding() {
-        if (charsetHolder.getName() == null) {
-            charsetHolder = 
CharsetHolder.getInstance(getCharsetFromContentType(getContentType()));
-        }
-
-        return charsetHolder.getName();
-    }
-
-
-    /**
-     * Get the character encoding used for this request.
-     *
-     * @return The value set via {@link #setCharset(Charset)} or if no call 
has been made to that method try to obtain
-     *             if from the content type.
-     *
-     * @throws UnsupportedEncodingException If the user agent has specified an 
invalid character encoding
-     *
-     * @deprecated Unused. This method will be removed in Tomcat 12.
-     */
-    @Deprecated
-    public Charset getCharset() throws UnsupportedEncodingException {
-        if (charsetHolder.getName() == null) {
-            // Populates charsetHolder
-            getCharacterEncoding();
-        }
-
-        return charsetHolder.getValidatedCharset();
-    }
-
-
-    /**
-     * Unused.
-     *
-     * @param charset The Charset to use for the request
-     *
-     * @deprecated Unused. This method will be removed in Tomcat 12.
-     */
-    @Deprecated
-    public void setCharset(Charset charset) {
-        charsetHolder = CharsetHolder.getInstance(charset);
-    }
-
-
     public CharsetHolder getCharsetHolder() {
         if (charsetHolder.getName() == null) {
             charsetHolder = 
CharsetHolder.getInstance(getCharsetFromContentType(getContentType()));
diff --git a/java/org/apache/coyote/Response.java 
b/java/org/apache/coyote/Response.java
index 70998333d5..bcc8a0c201 100644
--- a/java/org/apache/coyote/Response.java
+++ b/java/org/apache/coyote/Response.java
@@ -488,53 +488,6 @@ public final class Response {
     }
 
 
-    /**
-     * Overrides the character encoding used in the body of the response. This 
method must be called prior to writing
-     * output using getWriter().
-     *
-     * @param characterEncoding The name of character encoding.
-     *
-     * @throws UnsupportedEncodingException If the specified name is not 
recognised
-     *
-     * @deprecated Unused. Will be removed in Tomcat 12.
-     */
-    @Deprecated
-    public void setCharacterEncoding(String characterEncoding) throws 
UnsupportedEncodingException {
-        if (isCommitted()) {
-            return;
-        }
-
-        charsetHolder = CharsetHolder.getInstance(characterEncoding);
-        charsetHolder.validate();
-    }
-
-
-    /**
-     * Returns the current character set.
-     *
-     * @return The current character set
-     *
-     * @deprecated Unused. Will be removed in Tomcat 12.
-     */
-    @Deprecated
-    public Charset getCharset() {
-        return charsetHolder.getCharset();
-    }
-
-
-    /**
-     * Returns the name of the current encoding.
-     *
-     * @return The name of the current encoding
-     *
-     * @deprecated Unused. Will be removed in Tomcat 12.
-     */
-    @Deprecated
-    public String getCharacterEncoding() {
-        return charsetHolder.getName();
-    }
-
-
     public CharsetHolder getCharsetHolder() {
         return charsetHolder;
     }
diff --git a/java/org/apache/coyote/ajp/AjpProcessor.java 
b/java/org/apache/coyote/ajp/AjpProcessor.java
index fc5861765e..172e96437b 100644
--- a/java/org/apache/coyote/ajp/AjpProcessor.java
+++ b/java/org/apache/coyote/ajp/AjpProcessor.java
@@ -632,7 +632,6 @@ public class AjpProcessor extends AbstractProcessor {
     /**
      * After reading the request headers, we have to setup the request filters.
      */
-    @SuppressWarnings("deprecation")
     private void prepareRequest() {
 
         // Translate the HTTP method code to a String.
@@ -741,7 +740,6 @@ public class AjpProcessor extends AbstractProcessor {
                         }
                     } else if (n.equals(Constants.SC_A_SSL_PROTOCOL)) {
                         request.setAttribute(SSLSupport.SECURE_PROTOCOL_KEY, 
v);
-                        request.setAttribute(SSLSupport.PROTOCOL_VERSION_KEY, 
v);
                     } else if (n.equals("JK_LB_ACTIVATION")) {
                         request.setAttribute(n, v);
                     } else if (jakartaAttributeMapping.containsKey(n)) {
diff --git a/java/org/apache/juli/WebappProperties.java 
b/java/org/apache/juli/WebappProperties.java
index f348e7d136..b7fac9d746 100644
--- a/java/org/apache/juli/WebappProperties.java
+++ b/java/org/apache/juli/WebappProperties.java
@@ -45,16 +45,4 @@ public interface WebappProperties {
      * @return The name to use for the Service where the Host is deployed or 
null if none is available.
      */
     String getServiceName();
-
-    /**
-     * Enables JULI to determine if the web application includes a local 
configuration without JULI having to look for
-     * the file which it may not have permission to do when running under a 
SecurityManager.
-     *
-     * @return {@code true} if the web application includes a logging 
configuration at the standard location of
-     *             /WEB-INF/classes/logging.properties.
-     *
-     * @deprecated Unused. Will be removed in Tomcat 12 onwards.
-     */
-    @Deprecated
-    boolean hasLoggingConfig();
 }
diff --git a/java/org/apache/tomcat/util/buf/AbstractChunk.java 
b/java/org/apache/tomcat/util/buf/AbstractChunk.java
index bdc53c93e7..dcb557bf08 100644
--- a/java/org/apache/tomcat/util/buf/AbstractChunk.java
+++ b/java/org/apache/tomcat/util/buf/AbstractChunk.java
@@ -112,29 +112,6 @@ public abstract class AbstractChunk implements Cloneable, 
Serializable {
     }
 
 
-    /**
-     * @return start
-     * @deprecated Unused. This method will be removed in Tomcat 12.
-     */
-    @Deprecated
-    public int getOffset() {
-        return start;
-    }
-
-    /**
-     * Set start.
-     * @param off the new start
-     * @deprecated Unused. This method will be removed in Tomcat 12.
-     */
-    @Deprecated
-    public void setOffset(int off) {
-        if (end < off) {
-            end = off;
-        }
-        start = off;
-    }
-
-
     /**
      * @return the length of the data in the buffer
      */
diff --git a/java/org/apache/tomcat/util/http/parser/Cookie.java 
b/java/org/apache/tomcat/util/http/parser/Cookie.java
index 8f09d95adb..4ed2d65327 100644
--- a/java/org/apache/tomcat/util/http/parser/Cookie.java
+++ b/java/org/apache/tomcat/util/http/parser/Cookie.java
@@ -82,22 +82,6 @@ public class Cookie {
     }
 
 
-    /**
-     * Parse byte array as cookie header.
-     *
-     * @param bytes         Source
-     * @param offset        Start point in array
-     * @param len           Number of bytes to read
-     * @param serverCookies Structure to store results
-     *
-     * @deprecated Unused. This method will be removed in Tomcat 11 onwards.
-     */
-    @Deprecated
-    public static void parseCookie(byte[] bytes, int offset, int len, 
ServerCookies serverCookies) {
-        parseCookie(bytes, offset, len, serverCookies, 
CookiesWithoutEquals.IGNORE);
-    }
-
-
     /**
      * Parse byte array as cookie header.
      *
diff --git a/java/org/apache/tomcat/util/net/SSLSupport.java 
b/java/org/apache/tomcat/util/net/SSLSupport.java
index 528df94925..08749e5709 100644
--- a/java/org/apache/tomcat/util/net/SSLSupport.java
+++ b/java/org/apache/tomcat/util/net/SSLSupport.java
@@ -61,16 +61,6 @@ public interface SSLSupport {
     String SESSION_MGR =
             "jakarta.servlet.request.ssl_session_mgr";
 
-    /**
-     * The request attribute key under which the String indicating the protocol
-     * that created the SSL socket is recorded - e.g. TLSv1 or TLSv1.2 etc.
-     *
-     * @deprecated Replaced by {@link #SECURE_PROTOCOL_KEY}. This constant 
will be removed in Tomcat 12.
-     */
-    @Deprecated
-    String PROTOCOL_VERSION_KEY =
-            "org.apache.tomcat.util.net.secure_protocol_version";
-
     /**
      * The request attribute key under which the String indicating the ciphers
      * requested by the client are recorded.
diff --git a/test/org/apache/juli/TestClassLoaderLogManager.java 
b/test/org/apache/juli/TestClassLoaderLogManager.java
index 1235fbea75..c855f4b5bf 100644
--- a/test/org/apache/juli/TestClassLoaderLogManager.java
+++ b/test/org/apache/juli/TestClassLoaderLogManager.java
@@ -187,11 +187,6 @@ public class TestClassLoaderLogManager {
             return "Catalina";
         }
 
-        @Override
-        public boolean hasLoggingConfig() {
-            return true;
-        }
-
         @Override
         public URL findResource(String name) {
             if ("logging.properties".equals(name)) {


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

Reply via email to