[tomcat] 02/03: Clean-up - formatting. No functional change.
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit b4f09a0082acac7da9842d4cb003ff752917915e Author: Mark Thomas AuthorDate: Tue May 9 20:38:49 2023 +0100 Clean-up - formatting. No functional change. --- .../apache/catalina/filters/RateLimitFilter.java | 90 ++ .../apache/catalina/util/TimeBucketCounter.java| 48 +--- .../catalina/filters/TestRateLimitFilter.java | 14 ++-- 3 files changed, 66 insertions(+), 86 deletions(-) diff --git a/java/org/apache/catalina/filters/RateLimitFilter.java b/java/org/apache/catalina/filters/RateLimitFilter.java index f3ded50cf0..2b35243e84 100644 --- a/java/org/apache/catalina/filters/RateLimitFilter.java +++ b/java/org/apache/catalina/filters/RateLimitFilter.java @@ -33,45 +33,41 @@ import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.res.StringManager; /** - * Servlet filter that can help mitigate Denial of Service - * (DoS) and Brute Force attacks by limiting the number of a requests that are - * allowed from a single IP address within a time window (also referred - * to as a time bucket), e.g. 300 Requests per 60 seconds. - * - * The filter works by incrementing a counter in a time bucket for each IP - * address, and if the counter exceeds the allowed limit then further requests - * from that IP are dropped with a "429 Too many requests" response - * until the bucket time ends and a new bucket starts. - * - * The filter is optimized for efficiency and low overhead, so it converts - * some configured values to more efficient values. For example, a configuration - * of a 60 seconds time bucket is converted to 65.536 seconds. That allows - * for very fast bucket calculation using bit shift arithmetic. In order to remain - * true to the user intent, the configured number of requests is then multiplied - * by the same ratio, so a configuration of 100 Requests per 60 seconds, has the - * real values of 109 Requests per 65 seconds. - * - * It is common to set up different restrictions for different URIs. - * For example, a login page or authentication script is typically expected - * to get far less requests than the rest of the application, so you can add - * a filter definition that would allow only 5 requests per 15 seconds and map - * those URIs to it. - * - * You can set enforce to false - * to disable the termination of requests that exceed the allowed limit. Then - * your application code can inspect the Request Attribute - * org.apache.catalina.filters.RateLimitFilter.Count and decide - * how to handle the request based on other information that it has, e.g. allow - * more requests to certain users based on roles, etc. - * - * WARNING: if Tomcat is behind a reverse proxy then you must - * make sure that the Rate Limit Filter sees the client IP address, so if for - * example you are using the Remote IP Filter, - * then the filter mapping for the Rate Limit Filter must come after - * the mapping of the Remote IP Filter to ensure that each request has its IP - * address resolved before the Rate Limit Filter is applied. Failure to do so - * will count requests from different IPs in the same bucket and will result in - * a self inflicted DoS attack. + * + * Servlet filter that can help mitigate Denial of Service (DoS) and Brute Force attacks by limiting the number of a + * requests that are allowed from a single IP address within a time window (also referred to as a time bucket), e.g. 300 + * Requests per 60 seconds. + * + * + * The filter works by incrementing a counter in a time bucket for each IP address, and if the counter exceeds the + * allowed limit then further requests from that IP are dropped with a "429 Too many requests" response until + * the bucket time ends and a new bucket starts. + * + * + * The filter is optimized for efficiency and low overhead, so it converts some configured values to more efficient + * values. For example, a configuration of a 60 seconds time bucket is converted to 65.536 seconds. That allows for very + * fast bucket calculation using bit shift arithmetic. In order to remain true to the user intent, the configured number + * of requests is then multiplied by the same ratio, so a configuration of 100 Requests per 60 seconds, has the real + * values of 109 Requests per 65 seconds. + * + * + * It is common to set up different restrictions for different URIs. For example, a login page or authentication script + * is typically expected to get far less requests than the rest of the application, so you can add a filter definition + * that would allow only 5 requests per 15 seconds and map those URIs to it. + * + * + * You can set enforce to false to disable the termination of requests that exceed the allowed + * limit. Then your application code can inspect the Request Attribute + * org.apache.catalina.filters.RateLimitFilter
[tomcat] 02/03: Clean-up - formatting. No functional change.
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 61f237e4a6b771a586802b19d5b460dce52d0c0d Author: Mark Thomas AuthorDate: Tue May 9 20:38:49 2023 +0100 Clean-up - formatting. No functional change. --- .../apache/catalina/filters/RateLimitFilter.java | 91 ++ .../apache/catalina/util/TimeBucketCounter.java| 60 ++ .../catalina/filters/TestRateLimitFilter.java | 14 ++-- 3 files changed, 73 insertions(+), 92 deletions(-) diff --git a/java/org/apache/catalina/filters/RateLimitFilter.java b/java/org/apache/catalina/filters/RateLimitFilter.java index 7dd4f7a3a6..d164eee94e 100644 --- a/java/org/apache/catalina/filters/RateLimitFilter.java +++ b/java/org/apache/catalina/filters/RateLimitFilter.java @@ -33,45 +33,41 @@ import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.res.StringManager; /** - * Servlet filter that can help mitigate Denial of Service - * (DoS) and Brute Force attacks by limiting the number of a requests that are - * allowed from a single IP address within a time window (also referred - * to as a time bucket), e.g. 300 Requests per 60 seconds. - * - * The filter works by incrementing a counter in a time bucket for each IP - * address, and if the counter exceeds the allowed limit then further requests - * from that IP are dropped with a "429 Too many requests" response - * until the bucket time ends and a new bucket starts. - * - * The filter is optimized for efficiency and low overhead, so it converts - * some configured values to more efficient values. For example, a configuration - * of a 60 seconds time bucket is converted to 65.536 seconds. That allows - * for very fast bucket calculation using bit shift arithmetic. In order to remain - * true to the user intent, the configured number of requests is then multiplied - * by the same ratio, so a configuration of 100 Requests per 60 seconds, has the - * real values of 109 Requests per 65 seconds. - * - * It is common to set up different restrictions for different URIs. - * For example, a login page or authentication script is typically expected - * to get far less requests than the rest of the application, so you can add - * a filter definition that would allow only 5 requests per 15 seconds and map - * those URIs to it. - * - * You can set enforce to false - * to disable the termination of requests that exceed the allowed limit. Then - * your application code can inspect the Request Attribute - * org.apache.catalina.filters.RateLimitFilter.Count and decide - * how to handle the request based on other information that it has, e.g. allow - * more requests to certain users based on roles, etc. - * - * WARNING: if Tomcat is behind a reverse proxy then you must - * make sure that the Rate Limit Filter sees the client IP address, so if for - * example you are using the Remote IP Filter, - * then the filter mapping for the Rate Limit Filter must come after - * the mapping of the Remote IP Filter to ensure that each request has its IP - * address resolved before the Rate Limit Filter is applied. Failure to do so - * will count requests from different IPs in the same bucket and will result in - * a self inflicted DoS attack. + * + * Servlet filter that can help mitigate Denial of Service (DoS) and Brute Force attacks by limiting the number of a + * requests that are allowed from a single IP address within a time window (also referred to as a time bucket), e.g. 300 + * Requests per 60 seconds. + * + * + * The filter works by incrementing a counter in a time bucket for each IP address, and if the counter exceeds the + * allowed limit then further requests from that IP are dropped with a "429 Too many requests" response until + * the bucket time ends and a new bucket starts. + * + * + * The filter is optimized for efficiency and low overhead, so it converts some configured values to more efficient + * values. For example, a configuration of a 60 seconds time bucket is converted to 65.536 seconds. That allows for very + * fast bucket calculation using bit shift arithmetic. In order to remain true to the user intent, the configured number + * of requests is then multiplied by the same ratio, so a configuration of 100 Requests per 60 seconds, has the real + * values of 109 Requests per 65 seconds. + * + * + * It is common to set up different restrictions for different URIs. For example, a login page or authentication script + * is typically expected to get far less requests than the rest of the application, so you can add a filter definition + * that would allow only 5 requests per 15 seconds and map those URIs to it. + * + * + * You can set enforce to false to disable the termination of requests that exceed the allowed + * limit. Then your application code can inspect the Request Attribute + * org.apache.catalina.filters.RateLimitFilt
[tomcat] 02/03: Clean-up - formatting. No functional change.
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 05a542911b26f211f1f8b6a3db3f3a557b23b00f Author: Mark Thomas AuthorDate: Tue May 9 20:38:49 2023 +0100 Clean-up - formatting. No functional change. --- .../apache/catalina/filters/RateLimitFilter.java | 91 ++ .../apache/catalina/util/TimeBucketCounter.java| 60 ++ .../catalina/filters/TestRateLimitFilter.java | 14 ++-- 3 files changed, 73 insertions(+), 92 deletions(-) diff --git a/java/org/apache/catalina/filters/RateLimitFilter.java b/java/org/apache/catalina/filters/RateLimitFilter.java index 94e615452a..097485aef3 100644 --- a/java/org/apache/catalina/filters/RateLimitFilter.java +++ b/java/org/apache/catalina/filters/RateLimitFilter.java @@ -33,45 +33,41 @@ import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.res.StringManager; /** - * Servlet filter that can help mitigate Denial of Service - * (DoS) and Brute Force attacks by limiting the number of a requests that are - * allowed from a single IP address within a time window (also referred - * to as a time bucket), e.g. 300 Requests per 60 seconds. - * - * The filter works by incrementing a counter in a time bucket for each IP - * address, and if the counter exceeds the allowed limit then further requests - * from that IP are dropped with a "429 Too many requests" response - * until the bucket time ends and a new bucket starts. - * - * The filter is optimized for efficiency and low overhead, so it converts - * some configured values to more efficient values. For example, a configuration - * of a 60 seconds time bucket is converted to 65.536 seconds. That allows - * for very fast bucket calculation using bit shift arithmetic. In order to remain - * true to the user intent, the configured number of requests is then multiplied - * by the same ratio, so a configuration of 100 Requests per 60 seconds, has the - * real values of 109 Requests per 65 seconds. - * - * It is common to set up different restrictions for different URIs. - * For example, a login page or authentication script is typically expected - * to get far less requests than the rest of the application, so you can add - * a filter definition that would allow only 5 requests per 15 seconds and map - * those URIs to it. - * - * You can set enforce to false - * to disable the termination of requests that exceed the allowed limit. Then - * your application code can inspect the Request Attribute - * org.apache.catalina.filters.RateLimitFilter.Count and decide - * how to handle the request based on other information that it has, e.g. allow - * more requests to certain users based on roles, etc. - * - * WARNING: if Tomcat is behind a reverse proxy then you must - * make sure that the Rate Limit Filter sees the client IP address, so if for - * example you are using the Remote IP Filter, - * then the filter mapping for the Rate Limit Filter must come after - * the mapping of the Remote IP Filter to ensure that each request has its IP - * address resolved before the Rate Limit Filter is applied. Failure to do so - * will count requests from different IPs in the same bucket and will result in - * a self inflicted DoS attack. + * + * Servlet filter that can help mitigate Denial of Service (DoS) and Brute Force attacks by limiting the number of a + * requests that are allowed from a single IP address within a time window (also referred to as a time bucket), e.g. 300 + * Requests per 60 seconds. + * + * + * The filter works by incrementing a counter in a time bucket for each IP address, and if the counter exceeds the + * allowed limit then further requests from that IP are dropped with a "429 Too many requests" response until + * the bucket time ends and a new bucket starts. + * + * + * The filter is optimized for efficiency and low overhead, so it converts some configured values to more efficient + * values. For example, a configuration of a 60 seconds time bucket is converted to 65.536 seconds. That allows for very + * fast bucket calculation using bit shift arithmetic. In order to remain true to the user intent, the configured number + * of requests is then multiplied by the same ratio, so a configuration of 100 Requests per 60 seconds, has the real + * values of 109 Requests per 65 seconds. + * + * + * It is common to set up different restrictions for different URIs. For example, a login page or authentication script + * is typically expected to get far less requests than the rest of the application, so you can add a filter definition + * that would allow only 5 requests per 15 seconds and map those URIs to it. + * + * + * You can set enforce to false to disable the termination of requests that exceed the allowed + * limit. Then your application code can inspect the Request Attribute + * org.apache.catalina.filters.RateLimitFil
[tomcat] 02/03: Clean-up - formatting. No functional 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 commit 7ba678c566dc82e4f169e5bc25313b310140df8f Author: Mark Thomas AuthorDate: Tue May 9 20:38:49 2023 +0100 Clean-up - formatting. No functional change. --- .../apache/catalina/filters/RateLimitFilter.java | 91 ++ .../apache/catalina/util/TimeBucketCounter.java| 60 ++ .../catalina/filters/TestRateLimitFilter.java | 14 ++-- 3 files changed, 73 insertions(+), 92 deletions(-) diff --git a/java/org/apache/catalina/filters/RateLimitFilter.java b/java/org/apache/catalina/filters/RateLimitFilter.java index 94e615452a..097485aef3 100644 --- a/java/org/apache/catalina/filters/RateLimitFilter.java +++ b/java/org/apache/catalina/filters/RateLimitFilter.java @@ -33,45 +33,41 @@ import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.res.StringManager; /** - * Servlet filter that can help mitigate Denial of Service - * (DoS) and Brute Force attacks by limiting the number of a requests that are - * allowed from a single IP address within a time window (also referred - * to as a time bucket), e.g. 300 Requests per 60 seconds. - * - * The filter works by incrementing a counter in a time bucket for each IP - * address, and if the counter exceeds the allowed limit then further requests - * from that IP are dropped with a "429 Too many requests" response - * until the bucket time ends and a new bucket starts. - * - * The filter is optimized for efficiency and low overhead, so it converts - * some configured values to more efficient values. For example, a configuration - * of a 60 seconds time bucket is converted to 65.536 seconds. That allows - * for very fast bucket calculation using bit shift arithmetic. In order to remain - * true to the user intent, the configured number of requests is then multiplied - * by the same ratio, so a configuration of 100 Requests per 60 seconds, has the - * real values of 109 Requests per 65 seconds. - * - * It is common to set up different restrictions for different URIs. - * For example, a login page or authentication script is typically expected - * to get far less requests than the rest of the application, so you can add - * a filter definition that would allow only 5 requests per 15 seconds and map - * those URIs to it. - * - * You can set enforce to false - * to disable the termination of requests that exceed the allowed limit. Then - * your application code can inspect the Request Attribute - * org.apache.catalina.filters.RateLimitFilter.Count and decide - * how to handle the request based on other information that it has, e.g. allow - * more requests to certain users based on roles, etc. - * - * WARNING: if Tomcat is behind a reverse proxy then you must - * make sure that the Rate Limit Filter sees the client IP address, so if for - * example you are using the Remote IP Filter, - * then the filter mapping for the Rate Limit Filter must come after - * the mapping of the Remote IP Filter to ensure that each request has its IP - * address resolved before the Rate Limit Filter is applied. Failure to do so - * will count requests from different IPs in the same bucket and will result in - * a self inflicted DoS attack. + * + * Servlet filter that can help mitigate Denial of Service (DoS) and Brute Force attacks by limiting the number of a + * requests that are allowed from a single IP address within a time window (also referred to as a time bucket), e.g. 300 + * Requests per 60 seconds. + * + * + * The filter works by incrementing a counter in a time bucket for each IP address, and if the counter exceeds the + * allowed limit then further requests from that IP are dropped with a "429 Too many requests" response until + * the bucket time ends and a new bucket starts. + * + * + * The filter is optimized for efficiency and low overhead, so it converts some configured values to more efficient + * values. For example, a configuration of a 60 seconds time bucket is converted to 65.536 seconds. That allows for very + * fast bucket calculation using bit shift arithmetic. In order to remain true to the user intent, the configured number + * of requests is then multiplied by the same ratio, so a configuration of 100 Requests per 60 seconds, has the real + * values of 109 Requests per 65 seconds. + * + * + * It is common to set up different restrictions for different URIs. For example, a login page or authentication script + * is typically expected to get far less requests than the rest of the application, so you can add a filter definition + * that would allow only 5 requests per 15 seconds and map those URIs to it. + * + * + * You can set enforce to false to disable the termination of requests that exceed the allowed + * limit. Then your application code can inspect the Request Attribute + * org.apache.catalina.filters.RateLimitFilte
[tomcat] 02/03: Clean-up. No functional 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 commit 4a5766fc05960dfd1edbb4855eb6e92c0fd67cf0 Author: Mark Thomas AuthorDate: Tue Apr 11 16:36:27 2023 +0100 Clean-up. No functional change. --- .../tomcat/util/http/ConcurrentDateFormat.java | 5 +- .../apache/tomcat/util/http/CookieProcessor.java | 26 ++--- .../tomcat/util/http/CookieProcessorBase.java | 11 +- .../tomcat/util/http/FastHttpDateFormat.java | 16 +-- java/org/apache/tomcat/util/http/HeaderUtil.java | 10 +- java/org/apache/tomcat/util/http/MimeHeaders.java | 3 +- java/org/apache/tomcat/util/http/Parameters.java | 111 ++--- java/org/apache/tomcat/util/http/RequestUtil.java | 22 ++-- .../tomcat/util/http/Rfc6265CookieProcessor.java | 86 +++- java/org/apache/tomcat/util/http/ServerCookie.java | 14 ++- .../org/apache/tomcat/util/http/ServerCookies.java | 11 +- 11 files changed, 142 insertions(+), 173 deletions(-) diff --git a/java/org/apache/tomcat/util/http/ConcurrentDateFormat.java b/java/org/apache/tomcat/util/http/ConcurrentDateFormat.java index 02a456f20a..eb678aa5fb 100644 --- a/java/org/apache/tomcat/util/http/ConcurrentDateFormat.java +++ b/java/org/apache/tomcat/util/http/ConcurrentDateFormat.java @@ -25,9 +25,8 @@ import java.util.TimeZone; import java.util.concurrent.ConcurrentLinkedQueue; /** - * A thread safe wrapper around {@link SimpleDateFormat} that does not make use - * of ThreadLocal and - broadly - only creates enough SimpleDateFormat objects - * to satisfy the concurrency requirements. + * A thread safe wrapper around {@link SimpleDateFormat} that does not make use of ThreadLocal and - broadly - only + * creates enough SimpleDateFormat objects to satisfy the concurrency requirements. */ public class ConcurrentDateFormat { diff --git a/java/org/apache/tomcat/util/http/CookieProcessor.java b/java/org/apache/tomcat/util/http/CookieProcessor.java index 6ea0fe9b18..d84cc87099 100644 --- a/java/org/apache/tomcat/util/http/CookieProcessor.java +++ b/java/org/apache/tomcat/util/http/CookieProcessor.java @@ -27,33 +27,27 @@ public interface CookieProcessor { * Parse the provided headers into server cookie objects. * * @param headers The HTTP headers to parse - * @param serverCookies The server cookies object to populate with the - * results of the parsing + * @param serverCookies The server cookies object to populate with the results of the parsing */ void parseCookieHeader(MimeHeaders headers, ServerCookies serverCookies); /** - * Generate the {@code Set-Cookie} HTTP header value for the given Cookie. - * This method receives as parameter the servlet request so that it can make - * decisions based on request properties. One such use-case is decide if the - * SameSite attribute should be added to the cookie based on the User-Agent - * or other request header because there are browser versions incompatible - * with the SameSite attribute. This is described by https://www.chromium.org/updates/same-site/incompatible-clients";>the - * Chromium project. + * Generate the {@code Set-Cookie} HTTP header value for the given Cookie. This method receives as parameter the + * servlet request so that it can make decisions based on request properties. One such use-case is decide if the + * SameSite attribute should be added to the cookie based on the User-Agent or other request header because there + * are browser versions incompatible with the SameSite attribute. This is described by + * https://www.chromium.org/updates/same-site/incompatible-clients";>the Chromium project. * * @param request The servlet request + * @param cookie The cookie for which the header will be generated * - * @param cookie The cookie for which the header will be generated - * - * @return The header value in a form that can be added directly to the - * response + * @return The header value in a form that can be added directly to the response */ String generateHeader(Cookie cookie, HttpServletRequest request); /** - * Obtain the character set that will be used when converting between bytes - * and characters when parsing and/or generating HTTP headers for cookies. + * Obtain the character set that will be used when converting between bytes and characters when parsing and/or + * generating HTTP headers for cookies. * * @return The character set used for byte<->character conversions */ diff --git a/java/org/apache/tomcat/util/http/CookieProcessorBase.java b/java/org/apache/tomcat/util/http/CookieProcessorBase.java index 5c3b08bfd9..00c852cc75 100644 --- a/java/org/apache/tomcat/util/http/CookieProcessorBase.java +++ b/java/org/apach
[tomcat] 02/03: Clean-up. Reformatting. No functional change.
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit a33bbfa2fcd580b9bae18c85e75f477fa6fe1c9a Author: Mark Thomas AuthorDate: Wed Feb 22 19:44:22 2023 + Clean-up. Reformatting. No functional change. --- test/javax/el/TestArrayELResolver.java | 118 +--- test/javax/el/TestBeanELResolver.java | 202 + .../el/TestBeanELResolverVarargsInvocation.java| 16 +- test/javax/el/TestBeanNameELResolver.java | 117 +--- test/javax/el/TestCompositeELResolver.java | 3 +- test/javax/el/TestELContext.java | 24 +-- test/javax/el/TestELProcessor.java | 15 +- test/javax/el/TestELResolver.java | 32 +--- test/javax/el/TestEvaluationListener.java | 6 +- test/javax/el/TestImportHandler.java | 17 +- .../el/TestImportHandlerStandardPackages.java | 19 +- test/javax/el/TestListELResolver.java | 112 +--- test/javax/el/TestMapELResolver.java | 117 +--- test/javax/el/TestResourceBundleELResolver.java| 117 +--- test/javax/el/TestStaticFieldELResolver.java | 182 --- test/javax/el/TesterBean.java | 2 +- test/javax/el/TesterBeanNameResolver.java | 5 +- test/javax/el/TesterEvaluationListener.java| 3 +- test/javax/el/TesterImportHandlerPerformance.java | 14 +- 19 files changed, 450 insertions(+), 671 deletions(-) diff --git a/test/javax/el/TestArrayELResolver.java b/test/javax/el/TestArrayELResolver.java index cea9b97b16..41acd0e9b5 100644 --- a/test/javax/el/TestArrayELResolver.java +++ b/test/javax/el/TestArrayELResolver.java @@ -35,8 +35,7 @@ public class TestArrayELResolver { */ @Test public void testGetType02() { -doNegativeTest(new Object(), new Object(), MethodUnderTest.GET_TYPE, -true); +doNegativeTest(new Object(), new Object(), MethodUnderTest.GET_TYPE, true); } /** @@ -45,8 +44,7 @@ public class TestArrayELResolver { @Test public void testGetType03() { ArrayELResolver resolver = new ArrayELResolver(); -ELContext context = new StandardELContext( -ELManager.getExpressionFactory()); +ELContext context = new StandardELContext(ELManager.getExpressionFactory()); String[] base = new String[] { "element" }; Class result = resolver.getType(context, base, Integer.valueOf(0)); @@ -61,8 +59,7 @@ public class TestArrayELResolver { @Test(expected = PropertyNotFoundException.class) public void testGetType04() { ArrayELResolver resolver = new ArrayELResolver(); -ELContext context = new StandardELContext( -ELManager.getExpressionFactory()); +ELContext context = new StandardELContext(ELManager.getExpressionFactory()); String[] base = new String[] { "element" }; resolver.getType(context, base, Integer.valueOf(1)); @@ -74,8 +71,7 @@ public class TestArrayELResolver { @Test public void testGetType05() { ArrayELResolver resolver = new ArrayELResolver(); -ELContext context = new StandardELContext( -ELManager.getExpressionFactory()); +ELContext context = new StandardELContext(ELManager.getExpressionFactory()); String[] base = new String[] { "element" }; Class result = resolver.getType(context, base, "index"); @@ -98,8 +94,7 @@ public class TestArrayELResolver { */ @Test public void testGetValue02() { -doNegativeTest(new Object(), new Object(), MethodUnderTest.GET_VALUE, -true); +doNegativeTest(new Object(), new Object(), MethodUnderTest.GET_VALUE, true); } /** @@ -108,8 +103,7 @@ public class TestArrayELResolver { @Test public void testGetValue03() { ArrayELResolver resolver = new ArrayELResolver(); -ELContext context = new StandardELContext( -ELManager.getExpressionFactory()); +ELContext context = new StandardELContext(ELManager.getExpressionFactory()); String[] base = new String[] { "element" }; Object result = resolver.getValue(context, base, Integer.valueOf(0)); @@ -124,8 +118,7 @@ public class TestArrayELResolver { @Test(expected = IllegalArgumentException.class) public void testGetValue04() { ArrayELResolver resolver = new ArrayELResolver(); -ELContext context = new StandardELContext( -ELManager.getExpressionFactory()); +ELContext context = new StandardELContext(ELManager.getExpressionFactory()); String[] base = new String[] { "element" }; resolver.getValue(context, base, "key"); @@ -137,8 +130,7 @@ public class TestArrayELResolver { @
[tomcat] 02/03: Clean-up. Reformatting. No functional change.
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 5a6e5a6d7847b5569c265b8eb471f3b25cb32425 Author: Mark Thomas AuthorDate: Wed Feb 22 19:43:17 2023 + Clean-up. Reformatting. No functional change. --- test/javax/el/TestArrayELResolver.java | 147 ++- test/javax/el/TestBeanELResolver.java | 202 + .../el/TestBeanELResolverVarargsInvocation.java| 16 +- test/javax/el/TestBeanNameELResolver.java | 117 +--- test/javax/el/TestCompositeELResolver.java | 3 +- test/javax/el/TestELContext.java | 24 +-- test/javax/el/TestELProcessor.java | 15 +- test/javax/el/TestELResolver.java | 32 +--- test/javax/el/TestEvaluationListener.java | 6 +- test/javax/el/TestImportHandler.java | 17 +- .../el/TestImportHandlerStandardPackages.java | 39 ++-- test/javax/el/TestListELResolver.java | 112 +--- test/javax/el/TestMapELResolver.java | 117 +--- test/javax/el/TestResourceBundleELResolver.java| 117 +--- test/javax/el/TestStaticFieldELResolver.java | 182 --- test/javax/el/TesterBean.java | 2 +- test/javax/el/TesterBeanNameResolver.java | 5 +- test/javax/el/TesterEvaluationListener.java| 3 +- test/javax/el/TesterImportHandlerPerformance.java | 14 +- 19 files changed, 469 insertions(+), 701 deletions(-) diff --git a/test/javax/el/TestArrayELResolver.java b/test/javax/el/TestArrayELResolver.java index 69ae176e31..fddbf1aa78 100644 --- a/test/javax/el/TestArrayELResolver.java +++ b/test/javax/el/TestArrayELResolver.java @@ -35,8 +35,7 @@ public class TestArrayELResolver { */ @Test public void testGetType02() { -doNegativeTest(new Object(), new Object(), MethodUnderTest.GET_TYPE, -true); +doNegativeTest(new Object(), new Object(), MethodUnderTest.GET_TYPE, true); } /** @@ -45,8 +44,7 @@ public class TestArrayELResolver { @Test public void testGetType03() { ArrayELResolver resolver = new ArrayELResolver(); -ELContext context = new StandardELContext( -ELManager.getExpressionFactory()); +ELContext context = new StandardELContext(ELManager.getExpressionFactory()); String[] base = new String[] { "element" }; Class result = resolver.getType(context, base, Integer.valueOf(0)); @@ -61,8 +59,7 @@ public class TestArrayELResolver { @Test(expected = PropertyNotFoundException.class) public void testGetType04() { ArrayELResolver resolver = new ArrayELResolver(); -ELContext context = new StandardELContext( -ELManager.getExpressionFactory()); +ELContext context = new StandardELContext(ELManager.getExpressionFactory()); String[] base = new String[] { "element" }; resolver.getType(context, base, Integer.valueOf(1)); @@ -74,8 +71,7 @@ public class TestArrayELResolver { @Test public void testGetType05() { ArrayELResolver resolver = new ArrayELResolver(); -ELContext context = new StandardELContext( -ELManager.getExpressionFactory()); +ELContext context = new StandardELContext(ELManager.getExpressionFactory()); String[] base = new String[] { "element" }; Class result = resolver.getType(context, base, "index"); @@ -90,8 +86,7 @@ public class TestArrayELResolver { @Test public void testGetType06() { ArrayELResolver resolver = new ArrayELResolver(); -ELContext context = new StandardELContext( -ELManager.getExpressionFactory()); +ELContext context = new StandardELContext(ELManager.getExpressionFactory()); Class result = resolver.getType(context, null, "index"); @@ -113,8 +108,7 @@ public class TestArrayELResolver { */ @Test public void testGetValue02() { -doNegativeTest(new Object(), new Object(), MethodUnderTest.GET_VALUE, -true); +doNegativeTest(new Object(), new Object(), MethodUnderTest.GET_VALUE, true); } /** @@ -123,8 +117,7 @@ public class TestArrayELResolver { @Test public void testGetValue03() { ArrayELResolver resolver = new ArrayELResolver(); -ELContext context = new StandardELContext( -ELManager.getExpressionFactory()); +ELContext context = new StandardELContext(ELManager.getExpressionFactory()); String[] base = new String[] { "element" }; Object result = resolver.getValue(context, base, Integer.valueOf(0)); @@ -136,8 +129,7 @@ public class TestArrayELResolver { @Test public void testGetValueCoercion01() { ArrayELResolver
[tomcat] 02/03: Clean-up. Reformatting. No functional change.
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 6159e3599ea88b074085d9107ef3c5d8b31f8bd0 Author: Mark Thomas AuthorDate: Wed Feb 22 19:39:12 2023 + Clean-up. Reformatting. No functional change. --- test/jakarta/el/TestArrayELResolver.java | 147 ++- test/jakarta/el/TestBeanELResolver.java| 202 + .../el/TestBeanELResolverVarargsInvocation.java| 16 +- test/jakarta/el/TestBeanNameELResolver.java| 117 +--- test/jakarta/el/TestCompositeELResolver.java | 3 +- test/jakarta/el/TestELContext.java | 24 +-- test/jakarta/el/TestELProcessor.java | 15 +- test/jakarta/el/TestELResolver.java| 32 +--- test/jakarta/el/TestEvaluationListener.java| 6 +- test/jakarta/el/TestImportHandler.java | 17 +- .../el/TestImportHandlerStandardPackages.java | 37 ++-- test/jakarta/el/TestListELResolver.java| 112 +--- test/jakarta/el/TestMapELResolver.java | 117 +--- test/jakarta/el/TestResourceBundleELResolver.java | 117 +--- test/jakarta/el/TestStaticFieldELResolver.java | 182 --- test/jakarta/el/TesterBean.java| 2 +- test/jakarta/el/TesterBeanNameResolver.java| 5 +- test/jakarta/el/TesterEvaluationListener.java | 3 +- .../jakarta/el/TesterImportHandlerPerformance.java | 14 +- 19 files changed, 468 insertions(+), 700 deletions(-) diff --git a/test/jakarta/el/TestArrayELResolver.java b/test/jakarta/el/TestArrayELResolver.java index 00dda1c2d4..49f0e1f4b0 100644 --- a/test/jakarta/el/TestArrayELResolver.java +++ b/test/jakarta/el/TestArrayELResolver.java @@ -35,8 +35,7 @@ public class TestArrayELResolver { */ @Test public void testGetType02() { -doNegativeTest(new Object(), new Object(), MethodUnderTest.GET_TYPE, -true); +doNegativeTest(new Object(), new Object(), MethodUnderTest.GET_TYPE, true); } /** @@ -45,8 +44,7 @@ public class TestArrayELResolver { @Test public void testGetType03() { ArrayELResolver resolver = new ArrayELResolver(); -ELContext context = new StandardELContext( -ELManager.getExpressionFactory()); +ELContext context = new StandardELContext(ELManager.getExpressionFactory()); String[] base = new String[] { "element" }; Class result = resolver.getType(context, base, Integer.valueOf(0)); @@ -61,8 +59,7 @@ public class TestArrayELResolver { @Test(expected = PropertyNotFoundException.class) public void testGetType04() { ArrayELResolver resolver = new ArrayELResolver(); -ELContext context = new StandardELContext( -ELManager.getExpressionFactory()); +ELContext context = new StandardELContext(ELManager.getExpressionFactory()); String[] base = new String[] { "element" }; resolver.getType(context, base, Integer.valueOf(1)); @@ -74,8 +71,7 @@ public class TestArrayELResolver { @Test public void testGetType05() { ArrayELResolver resolver = new ArrayELResolver(); -ELContext context = new StandardELContext( -ELManager.getExpressionFactory()); +ELContext context = new StandardELContext(ELManager.getExpressionFactory()); String[] base = new String[] { "element" }; Class result = resolver.getType(context, base, "index"); @@ -90,8 +86,7 @@ public class TestArrayELResolver { @Test public void testGetType06() { ArrayELResolver resolver = new ArrayELResolver(); -ELContext context = new StandardELContext( -ELManager.getExpressionFactory()); +ELContext context = new StandardELContext(ELManager.getExpressionFactory()); Class result = resolver.getType(context, null, "index"); @@ -113,8 +108,7 @@ public class TestArrayELResolver { */ @Test public void testGetValue02() { -doNegativeTest(new Object(), new Object(), MethodUnderTest.GET_VALUE, -true); +doNegativeTest(new Object(), new Object(), MethodUnderTest.GET_VALUE, true); } /** @@ -123,8 +117,7 @@ public class TestArrayELResolver { @Test public void testGetValue03() { ArrayELResolver resolver = new ArrayELResolver(); -ELContext context = new StandardELContext( -ELManager.getExpressionFactory()); +ELContext context = new StandardELContext(ELManager.getExpressionFactory()); String[] base = new String[] { "element" }; Object result = resolver.getValue(context, base, Integer.valueOf(0)); @@ -136,8 +129,7 @@ public class TestArrayELResolver { @Test public void testGetValueCoercion01() { ArrayEL
[tomcat] 02/03: Clean-up.
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 9b773c025172253bde78c675a2f3327a0201ba2c Author: Mark Thomas AuthorDate: Mon Jul 8 10:58:45 2019 +0100 Clean-up. Whitespace. Braces. Use service. Use ReflectiveOperationException. Use interfaces rather than concrete types. Improves alignment with 9.0.x. --- .../apache/catalina/core/ApplicationContext.java | 113 + 1 file changed, 46 insertions(+), 67 deletions(-) diff --git a/java/org/apache/catalina/core/ApplicationContext.java b/java/org/apache/catalina/core/ApplicationContext.java index 9d9f306..250061a 100644 --- a/java/org/apache/catalina/core/ApplicationContext.java +++ b/java/org/apache/catalina/core/ApplicationContext.java @@ -182,8 +182,7 @@ public class ApplicationContext implements org.apache.catalina.servlet4preview.S /** * The string manager for this package. */ -private static final StringManager sm = - StringManager.getManager(Constants.Package); +private static final StringManager sm = StringManager.getManager(Constants.Package); /** @@ -264,7 +263,7 @@ public class ApplicationContext implements org.apache.catalina.servlet4preview.S pathMB.setString(uri); MappingData mappingData = new MappingData(); -((Engine) host.getParent()).getService().getMapper().map(hostMB, pathMB, null, mappingData); +service.getMapper().map(hostMB, pathMB, null, mappingData); child = mappingData.context; } } catch (Throwable t) { @@ -596,8 +595,7 @@ public class ApplicationContext implements org.apache.catalina.servlet4preview.S return null; } if (!path.startsWith("/")) { -throw new IllegalArgumentException -(sm.getString("applicationContext.resourcePaths.iae", path)); +throw new IllegalArgumentException (sm.getString("applicationContext.resourcePaths.iae", path)); } WebResourceRoot resources = context.getResources(); @@ -678,26 +676,23 @@ public class ApplicationContext implements org.apache.catalina.servlet4preview.S // Notify interested application event listeners Object listeners[] = context.getApplicationEventListeners(); -if ((listeners == null) || (listeners.length == 0)) +if ((listeners == null) || (listeners.length == 0)) { return; -ServletContextAttributeEvent event = - new ServletContextAttributeEvent(context.getServletContext(), -name, value); +} +ServletContextAttributeEvent event = new ServletContextAttributeEvent( +context.getServletContext(), name, value); for (int i = 0; i < listeners.length; i++) { -if (!(listeners[i] instanceof ServletContextAttributeListener)) +if (!(listeners[i] instanceof ServletContextAttributeListener)) { continue; -ServletContextAttributeListener listener = -(ServletContextAttributeListener) listeners[i]; +} +ServletContextAttributeListener listener = (ServletContextAttributeListener) listeners[i]; try { -context.fireContainerEvent("beforeContextAttributeRemoved", - listener); +context.fireContainerEvent("beforeContextAttributeRemoved", listener); listener.attributeRemoved(event); -context.fireContainerEvent("afterContextAttributeRemoved", - listener); +context.fireContainerEvent("afterContextAttributeRemoved", listener); } catch (Throwable t) { ExceptionUtils.handleThrowable(t); -context.fireContainerEvent("afterContextAttributeRemoved", - listener); +context.fireContainerEvent("afterContextAttributeRemoved", listener); // FIXME - should we do anything besides log these? log(sm.getString("applicationContext.attributeEvent"), t); } @@ -709,8 +704,7 @@ public class ApplicationContext implements org.apache.catalina.servlet4preview.S public void setAttribute(String name, Object value) { // Name cannot be null if (name == null) { -throw new NullPointerException -(sm.getString("applicationContext.setAttribute.namenull")); +throw new NullPointerException(sm.getString("applicationContext.setAttribute.namenull")); } // Null value is the same as removeAttribute() @@ -721,53 +715,47 @@ public class ApplicationContext implements org.apache.catalina.servlet4preview.S
[tomcat] 02/03: Clean-up
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 7.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 4e45ea31734f52271ceb96a1db40967632230c50 Author: Mark Thomas AuthorDate: Fri Jul 5 18:19:32 2019 +0100 Clean-up --- build.properties.default | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build.properties.default b/build.properties.default index 11919da..92cea40 100644 --- a/build.properties.default +++ b/build.properties.default @@ -277,7 +277,7 @@ objenesis.jar=${objenesis.home}/objenesis-${objenesis.version}.jar objenesis.loc=${base-maven.loc}/org/objenesis/objenesis/${objenesis.version}/objenesis-${objenesis.version}.jar # - Checkstyle, version 6.0 or later - -# Limited to 6.1.1 since that is the latest release that supports Java 6 +# Checkstyle 6.1.1 is the last release that supports Java 6 # Gump uses the latest checkstyle and the configuration format is incompatible # between the latest version and 6.1.1 # Therefore, use checkstyle-backport-jre6 @@ -286,9 +286,8 @@ checkstyle.checksum.enabled=true checkstyle.checksum.algorithm=MD5|SHA-1 checkstyle.checksum.value=e268f16a5cab5b291546fae909e3f9b3|b626c3e518f315faf860b521807c31a03c9e2d8a checkstyle.home=${base.path}/checkstyle-backport-jre6-${checkstyle.version} -checkstyle.loc=${base-checkstyle.loc}/com/puppycrawl/tools/checkstyle-backport-jre6/${checkstyle.version}/checkstyle-backport-jre6-${checkstyle.version}-all.jar checkstyle.jar=${checkstyle.home}/checkstyle-${checkstyle.version}-all.jar - +checkstyle.loc=${base-checkstyle.loc}/com/puppycrawl/tools/checkstyle-backport-jre6/${checkstyle.version}/checkstyle-backport-jre6-${checkstyle.version}-all.jar # - Cobertura code coverage tool - cobertura.version=2.0.3 - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 02/03: Clean-up. No functional change
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit df068670aa641e9ee2ea84202f147805dd5158ea Author: Mark Thomas AuthorDate: Fri Jul 5 13:37:20 2019 +0100 Clean-up. No functional change --- build.properties.default | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/build.properties.default b/build.properties.default index b40b1de..f0fd62f 100644 --- a/build.properties.default +++ b/build.properties.default @@ -109,8 +109,8 @@ jaxrpc-lib.checksum.enabled=true jaxrpc-lib.checksum.algorithm=MD5|SHA-1 jaxrpc-lib.checksum.value=4bebba22a4cdb9f68e16c45129770333|fe9371d33dc3e1646d4d13bde19614283eb998b1 jaxrpc-lib.home=${base.path}/jaxrpc-${jaxrpc-lib.version} -jaxrpc-lib.loc=${base-maven.loc}/geronimo-spec/geronimo-spec-jaxrpc/${jaxrpc-lib.version}/geronimo-spec-jaxrpc-${jaxrpc-lib.version}.jar jaxrpc-lib.jar=${jaxrpc-lib.home}/geronimo-spec-jaxrpc-${jaxrpc-lib.version}.jar +jaxrpc-lib.loc=${base-maven.loc}/geronimo-spec/geronimo-spec-jaxrpc/${jaxrpc-lib.version}/geronimo-spec-jaxrpc-${jaxrpc-lib.version}.jar # - Webservices - WSDL4J - wsdl4j-lib.version=1.6.3 @@ -118,11 +118,11 @@ wsdl4j-lib.checksum.enabled=true wsdl4j-lib.checksum.algorithm=MD5|SHA-1 wsdl4j-lib.checksum.value=cfc28d89625c5e88589aec7a9aee0208|6d106a6845a3d3477a1560008479312888e94f2f wsdl4j-lib.home=${base.path}/wsdl4j-${wsdl4j-lib.version} -wsdl4j-lib.loc=${base-maven.loc}/wsdl4j/wsdl4j/${wsdl4j-lib.version}/wsdl4j-${wsdl4j-lib.version}.jar wsdl4j-lib.jar=${wsdl4j-lib.home}/wsdl4j-${wsdl4j-lib.version}.jar +wsdl4j-lib.loc=${base-maven.loc}/wsdl4j/wsdl4j/${wsdl4j-lib.version}/wsdl4j-${wsdl4j-lib.version}.jar # - Eclipse JDT, version 4.5.1 or later -# -# See https://wiki.apache.org/tomcat/JDTCoreBatchCompiler before updating +# See https://cwiki.apache.org/confluence/display/TOMCAT/Managing+Tomcat%27s+Dependency+on+the+Eclipse+JDT+Core+Batch+Compiler # # 4.6.3 is the latest release that runs on Java 7 # Later versions can be used but the official builds need to use 4.6.3 @@ -253,8 +253,8 @@ checkstyle.checksum.enabled=true checkstyle.checksum.algorithm=MD5|SHA-1 checkstyle.checksum.value=9180ab8b8219b262bfe88f26fd95d26d|11a02d7b0374f8a82fbd76361a69756faa6aefa0 checkstyle.home=${base.path}/checkstyle-${checkstyle.version} -checkstyle.loc=${base-sf.loc}/checkstyle/checkstyle/${checkstyle.version}/checkstyle-${checkstyle.version}-all.jar checkstyle.jar=${checkstyle.home}/checkstyle-${checkstyle.version}-all.jar +checkstyle.loc=${base-sf.loc}/checkstyle/checkstyle/${checkstyle.version}/checkstyle-${checkstyle.version}-all.jar # - Cobertura code coverage tool - cobertura.version=2.1.1 @@ -263,7 +263,6 @@ cobertura.checksum.algorithm=MD5|SHA-1 cobertura.checksum.value=4f46638aa8e4d89565c038092398ea06|99cb44d36555feedcedc46263c23c2f5394ef342 cobertura.home=${base.path}/cobertura-${cobertura.version} cobertura.jar=${cobertura.home}/cobertura-${cobertura.version}.jar -cobertura.lib=${cobertura.home}/lib cobertura.loc=${base-sf.loc}/cobertura/cobertura-2.1.1-bin.tar.gz # - Findbugs - - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org