You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2023/01/24 13:10:54 UTC

[tomcat] branch main updated: Deprecation for int -> long change

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 91786da002 Deprecation for int -> long change
91786da002 is described below

commit 91786da002450cc12384a306a4e8819fff88bec7
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Jan 24 13:10:47 2023 +0000

    Deprecation for int -> long change
---
 java/org/apache/catalina/core/StandardContext.java |  8 ++++++++
 java/org/apache/catalina/core/StandardWrapper.java | 18 ++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/java/org/apache/catalina/core/StandardContext.java b/java/org/apache/catalina/core/StandardContext.java
index 459d5b4254..e0ca2f97c5 100644
--- a/java/org/apache/catalina/core/StandardContext.java
+++ b/java/org/apache/catalina/core/StandardContext.java
@@ -4094,7 +4094,11 @@ public class StandardContext extends ContainerBase implements Context, Notificat
      * Gets the cumulative request count of all servlets in this StandardContext.
      *
      * @return Cumulative request count of all servlets in this StandardContext
+     *
+     * @deprecated The return type will change to long in Tomcat 11 onwards. Callers of this method should switch to
+     *                 storing the result of calls to this method in a long value rather than an int.
      */
+    @Deprecated
     public int getRequestCount() {
 
         int result = 0;
@@ -4113,7 +4117,11 @@ public class StandardContext extends ContainerBase implements Context, Notificat
      * Gets the cumulative error count of all servlets in this StandardContext.
      *
      * @return Cumulative error count of all servlets in this StandardContext
+     *
+     * @deprecated The return type will change to long in Tomcat 11 onwards. Callers of this method should switch to
+     *                 storing the result of calls to this method in a long value rather than an int.
      */
+    @Deprecated
     public int getErrorCount() {
 
         int result = 0;
diff --git a/java/org/apache/catalina/core/StandardWrapper.java b/java/org/apache/catalina/core/StandardWrapper.java
index e81964ef35..d0d89d3aec 100644
--- a/java/org/apache/catalina/core/StandardWrapper.java
+++ b/java/org/apache/catalina/core/StandardWrapper.java
@@ -1174,10 +1174,28 @@ public class StandardWrapper extends ContainerBase implements ServletConfig, Wra
         return swValve.getMinTime();
     }
 
+    /**
+     * Returns the number of requests processed by the wrapper.
+     *
+     * @return the number of requests processed by the wrapper.
+     *
+     * @deprecated The return type will change to long in Tomcat 11 onwards. Callers of this method should switch to
+     *                 storing the result of calls to this method in a long value rather than an int.
+     */
+    @Deprecated
     public int getRequestCount() {
         return swValve.getRequestCount();
     }
 
+    /**
+     * Returns the number of requests processed by the wrapper that resulted in an error.
+     *
+     * @return the number of requests processed by the wrapper that resulted in an error.
+     *
+     * @deprecated The return type will change to long in Tomcat 11 onwards. Callers of this method should switch to
+     *                 storing the result of calls to this method in a long value rather than an int.
+     */
+    @Deprecated
     public int getErrorCount() {
         return swValve.getErrorCount();
     }


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