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

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


The following commit(s) were added to refs/heads/11.0.x by this push:
     new f36a2c0d7f Fix checkstyle warnings
f36a2c0d7f is described below

commit f36a2c0d7f8c321b94867c90db71f3d55d5826bb
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Sun Oct 6 17:20:40 2024 +0100

    Fix checkstyle warnings
---
 java/org/apache/catalina/util/FastRateLimiter.java      |  7 ++++---
 java/org/apache/catalina/util/RateLimiter.java          | 17 +++++++++--------
 .../apache/catalina/filters/TestRateLimitFilter.java    |  2 +-
 3 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/java/org/apache/catalina/util/FastRateLimiter.java 
b/java/org/apache/catalina/util/FastRateLimiter.java
index bf2404ed1b..25c6546663 100644
--- a/java/org/apache/catalina/util/FastRateLimiter.java
+++ b/java/org/apache/catalina/util/FastRateLimiter.java
@@ -17,13 +17,14 @@
 
 package org.apache.catalina.util;
 
+import java.util.concurrent.ScheduledExecutorService;
+
 import jakarta.servlet.FilterConfig;
-import org.apache.tomcat.util.threads.ScheduledThreadPoolExecutor;
 
-import java.util.concurrent.ScheduledExecutorService;
+import org.apache.tomcat.util.threads.ScheduledThreadPoolExecutor;
 
 /**
- * A RateLimiter that compromises accuracy for speed in order to provide 
maximum throughput
+ * A RateLimiter that compromises accuracy for speed in order to provide 
maximum throughput.
  */
 public class FastRateLimiter implements RateLimiter {
 
diff --git a/java/org/apache/catalina/util/RateLimiter.java 
b/java/org/apache/catalina/util/RateLimiter.java
index fb3bb0d855..c13f794fbc 100644
--- a/java/org/apache/catalina/util/RateLimiter.java
+++ b/java/org/apache/catalina/util/RateLimiter.java
@@ -27,9 +27,9 @@ public interface RateLimiter {
     int getDuration();
 
     /**
-     * sets the configured duration value in seconds
+     * Sets the configured duration value in seconds.
      *
-     * @param duration
+     * @param duration The duration of the time window in seconds
      */
     void setDuration(int duration);
 
@@ -39,29 +39,30 @@ public interface RateLimiter {
     int getRequests();
 
     /**
-     * sets the configured number of requests allowed per time window
+     * Sets the configured number of requests allowed per time window.
      *
-     * @param requests
+     * @param requests The number of requests per time window
      */
     void setRequests(int requests);
 
     /**
-     * increments the number of requests by the given ipAddress in the current 
time window
+     * Increments the number of requests by the given ipAddress in the current 
time window.
      *
      * @param ipAddress the ip address
+     *
      * @return the new value after incrementing
      */
     int increment(String ipAddress);
 
     /**
-     * cleanup no longer needed resources
+     * Cleanup no longer needed resources.
      */
     void destroy();
 
     /**
-     * pass the FilterConfig to configure the filter
+     * Pass the FilterConfig to configure the filter.
      *
-     * @param filterConfig
+     * @param filterConfig The FilterConfig used to configure the associated 
filter
      */
     void setFilterConfig(FilterConfig filterConfig);
 }
diff --git a/test/org/apache/catalina/filters/TestRateLimitFilter.java 
b/test/org/apache/catalina/filters/TestRateLimitFilter.java
index 57d02307f3..d07389c58c 100644
--- a/test/org/apache/catalina/filters/TestRateLimitFilter.java
+++ b/test/org/apache/catalina/filters/TestRateLimitFilter.java
@@ -24,7 +24,6 @@ import jakarta.servlet.FilterChain;
 import jakarta.servlet.FilterConfig;
 import jakarta.servlet.ServletException;
 
-import org.apache.catalina.util.FastRateLimiter;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -33,6 +32,7 @@ import 
org.apache.catalina.filters.TestRemoteIpFilter.MockFilterChain;
 import org.apache.catalina.filters.TestRemoteIpFilter.MockHttpServletRequest;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.catalina.util.FastRateLimiter;
 import org.apache.tomcat.unittest.TesterResponse;
 import org.apache.tomcat.util.descriptor.web.FilterDef;
 import org.apache.tomcat.util.descriptor.web.FilterMap;


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

Reply via email to