(tomcat) branch 10.1.x updated: Code clean-up - formatting. No functional change.

2024-10-22 Thread markt
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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new a93e2db13d Code clean-up - formatting. No functional change.
a93e2db13d is described below

commit a93e2db13da19f7866c62cd98a63ef891006cef6
Author: Mark Thomas 
AuthorDate: Tue Oct 22 09:39:31 2024 +0100

Code clean-up - formatting. No functional change.
---
 .../apache/catalina/filters/RateLimitFilter.java   | 18 -
 .../apache/catalina/servlets/WebdavServlet.java| 23 --
 java/org/apache/catalina/util/FastRateLimiter.java |  2 +-
 3 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/java/org/apache/catalina/filters/RateLimitFilter.java 
b/java/org/apache/catalina/filters/RateLimitFilter.java
index c9f5c83c7c..6c002e1ef8 100644
--- a/java/org/apache/catalina/filters/RateLimitFilter.java
+++ b/java/org/apache/catalina/filters/RateLimitFilter.java
@@ -48,8 +48,8 @@ import org.apache.tomcat.util.res.StringManager;
  * 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. You can specify
- * a different class as long as it implements the 
org.apache.catalina.util.RateLimiter interface.
+ * configuration of 100 Requests per 60 seconds, has the real values of 109 
Requests per 65 seconds. You can specify a
+ * different class as long as it implements the 
org.apache.catalina.util.RateLimiter interface.
  * 
  * 
  * It is common to set up different restrictions for different URIs. For 
example, a login page or authentication script
@@ -164,7 +164,7 @@ public class RateLimitFilter extends FilterBase {
 super.init(filterConfig);
 
 try {
-rateLimiter = 
(RateLimiter)Class.forName(rateLimitClassName).getConstructor().newInstance();
+rateLimiter = (RateLimiter) 
Class.forName(rateLimitClassName).getConstructor().newInstance();
 } catch (ReflectiveOperationException e) {
 throw new ServletException(e);
 }
@@ -175,10 +175,9 @@ public class RateLimitFilter extends FilterBase {
 
 filterName = filterConfig.getFilterName();
 
-log.info(sm.getString("rateLimitFilter.initialized", filterName,
-Integer.valueOf(bucketRequests), Integer.valueOf(bucketDuration),
-Integer.valueOf(rateLimiter.getRequests()), 
Integer.valueOf(rateLimiter.getDuration()),
-(!enforce ? "Not " : "") + "enforcing"));
+log.info(sm.getString("rateLimitFilter.initialized", filterName, 
Integer.valueOf(bucketRequests),
+Integer.valueOf(bucketDuration), 
Integer.valueOf(rateLimiter.getRequests()),
+Integer.valueOf(rateLimiter.getDuration()), (!enforce ? "Not " 
: "") + "enforcing"));
 }
 
 @Override
@@ -192,9 +191,8 @@ public class RateLimitFilter extends FilterBase {
 
 if (reqCount > rateLimiter.getRequests()) {
 
-log.warn(sm.getString("rateLimitFilter.maxRequestsExceeded", 
filterName,
-Integer.valueOf(reqCount), ipAddr, 
Integer.valueOf(rateLimiter.getRequests()),
-Integer.valueOf(rateLimiter.getDuration(;
+log.warn(sm.getString("rateLimitFilter.maxRequestsExceeded", 
filterName, Integer.valueOf(reqCount), ipAddr,
+Integer.valueOf(rateLimiter.getRequests()), 
Integer.valueOf(rateLimiter.getDuration(;
 
 if (enforce) {
 ((HttpServletResponse) response).sendError(statusCode, 
statusMessage);
diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java 
b/java/org/apache/catalina/servlets/WebdavServlet.java
index 4831358a7f..fe5fbfc123 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -265,7 +265,8 @@ public class WebdavServlet extends DefaultServlet 
implements PeriodicEventListen
 
 // Validate that the Servlet is only mapped to wildcard mappings
 String servletName = getServletConfig().getServletName();
-ServletRegistration servletRegistration = 
getServletConfig().getServletContext().getServletRegistration(servletName);
+ServletRegistration servletRegistration =
+
getServletConfig().getServletContext().getServletRegistration(servletName);
 Collection servletMappings = servletRegistration.getMappings();
 for (String mapping : servletMappings) {
 if (!mapping.endsWith("/*")) {
@@ -1087,7 +1088,8 @@ public class WebdavServlet exten

(tomcat) branch 10.1.x updated: Code clean-up. Formatting. No functional change.

2024-09-20 Thread markt
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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 6501f66cfe Code clean-up. Formatting. No functional change.
6501f66cfe is described below

commit 6501f66cfe0824ced499148d4a1e8ca57c7f32cb
Author: Mark Thomas 
AuthorDate: Fri Sep 20 15:13:42 2024 +0100

Code clean-up. Formatting. No functional change.
---
 .../jasper/compiler/tagplugin/TagPlugin.java   | 11 ++--
 .../compiler/tagplugin/TagPluginContext.java   | 67 +++---
 2 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/java/org/apache/jasper/compiler/tagplugin/TagPlugin.java 
b/java/org/apache/jasper/compiler/tagplugin/TagPlugin.java
index 422794760a..e1711c1d5c 100644
--- a/java/org/apache/jasper/compiler/tagplugin/TagPlugin.java
+++ b/java/org/apache/jasper/compiler/tagplugin/TagPlugin.java
@@ -17,18 +17,17 @@
 package org.apache.jasper.compiler.tagplugin;
 
 /**
- * This interface is to be implemented by the plugin author, to supply
- * an alternate implementation of the tag handlers.  It can be used to
- * specify the Java codes to be generated when a tag is invoked.
- *
- * An implementation of this interface must be registered in a file
- * named "tagPlugins.xml" under WEB-INF.
+ * This interface is to be implemented by the plugin author, to supply an 
alternate implementation of the tag handlers.
+ * It can be used to specify the Java codes to be generated when a tag is 
invoked.
+ * 
+ * An implementation of this interface must be registered in a file named 
"tagPlugins.xml" under WEB-INF.
  */
 
 public interface TagPlugin {
 
 /**
  * Generate codes for a custom tag.
+ *
  * @param ctxt a TagPluginContext for accessing Jasper functions
  */
 void doTag(TagPluginContext ctxt);
diff --git a/java/org/apache/jasper/compiler/tagplugin/TagPluginContext.java 
b/java/org/apache/jasper/compiler/tagplugin/TagPluginContext.java
index b8c7d2bdd7..7f6ad2c098 100644
--- a/java/org/apache/jasper/compiler/tagplugin/TagPluginContext.java
+++ b/java/org/apache/jasper/compiler/tagplugin/TagPluginContext.java
@@ -18,9 +18,8 @@ package org.apache.jasper.compiler.tagplugin;
 
 
 /**
- * This interface allows the plugin author to make inquiries about the
- * properties of the current tag, and to use Jasper resources to generate
- * direct Java codes in place of tag handler invocations.
+ * This interface allows the plugin author to make inquiries about the 
properties of the current tag, and to use Jasper
+ * resources to generate direct Java codes in place of tag handler invocations.
  */
 
 public interface TagPluginContext {
@@ -31,6 +30,7 @@ public interface TagPluginContext {
 
 /**
  * @param attribute Name of the attribute
+ *
  * @return true if the attribute is specified in the tag
  */
 boolean isAttributeSpecified(String attribute);
@@ -42,47 +42,48 @@ public interface TagPluginContext {
 
 /**
  * Generate an import statement
+ *
  * @param s Name of the import class, '*' allowed.
  */
 void generateImport(String s);
 
 /**
- * Generate a declaration in the of the generated class.  This can be
- * used to declare an inner class, a method, or a class variable.
- * @param id A unique ID identifying the declaration.  It is not
- *   part of the declaration, and is used to ensure that the
- *   declaration will only appear once.  If this method is
- *   invoked with the same id more than once in the translation
- *   unit, only the first declaration will be taken.
+ * Generate a declaration in the of the generated class. This can be used 
to declare an inner class, a method, or a
+ * class variable.
+ *
+ * @param id   A unique ID identifying the declaration. It is not part of 
the declaration, and is used to ensure
+ * that the declaration will only appear once. If this 
method is invoked with the same id more than
+ * once in the translation unit, only the first 
declaration will be taken.
  * @param text The text of the declaration.
  */
 void generateDeclaration(String id, String text);
 
 /**
  * Generate Java source code scriptlet
+ *
  * @param s the scriptlet (raw Java source)
  */
 void generateJavaSource(String s);
 
 /**
  * @param attribute The attribute name
- * @return true if the attribute is specified and its value is a
- * translation-time constant.
+ *
+ * @return true if the attribute is specified and its value is a 
translation-time constant.
  */
 boolean isConstantAttribute(String attribute);
 
 /**
  * @param attribute The attribute name
- * @return A string that is the value of a constant attribute.  Undefined
- * 

(tomcat) branch 10.1.x updated: Code clean-up. Formatting. No functional change.

2024-06-28 Thread markt
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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 20bcaf20cc Code clean-up. Formatting. No functional change.
20bcaf20cc is described below

commit 20bcaf20ccf8d7bbb8e765bb4afdbdc6002f5787
Author: Mark Thomas 
AuthorDate: Fri Jun 28 15:56:10 2024 +0100

Code clean-up. Formatting. No functional change.
---
 java/org/apache/coyote/ajp/AbstractAjpProtocol.java |  4 ++--
 java/org/apache/coyote/ajp/AjpProcessor.java|  8 
 java/org/apache/coyote/ajp/Constants.java   | 16 
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/java/org/apache/coyote/ajp/AbstractAjpProtocol.java 
b/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
index 8241a7b964..7e785affaa 100644
--- a/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
+++ b/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
@@ -43,7 +43,7 @@ public abstract class AbstractAjpProtocol extends 
AbstractProtocol {
 protected static final StringManager sm = 
StringManager.getManager(AbstractAjpProtocol.class);
 
 
-public AbstractAjpProtocol(AbstractEndpoint endpoint) {
+public AbstractAjpProtocol(AbstractEndpoint endpoint) {
 super(endpoint);
 setConnectionTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
 // AJP does not use Send File
@@ -63,7 +63,7 @@ public abstract class AbstractAjpProtocol extends 
AbstractProtocol {
  * {@inheritDoc} Overridden to make getter accessible to other classes in 
this package.
  */
 @Override
-protected AbstractEndpoint getEndpoint() {
+protected AbstractEndpoint getEndpoint() {
 return super.getEndpoint();
 }
 
diff --git a/java/org/apache/coyote/ajp/AjpProcessor.java 
b/java/org/apache/coyote/ajp/AjpProcessor.java
index 160c5f8a0c..caf2d5700e 100644
--- a/java/org/apache/coyote/ajp/AjpProcessor.java
+++ b/java/org/apache/coyote/ajp/AjpProcessor.java
@@ -89,7 +89,7 @@ public class AjpProcessor extends AbstractProcessor {
 private static final byte[] pongMessageArray;
 
 
-private static final Map jakartaAttributeMapping;
+private static final Map jakartaAttributeMapping;
 private static final Set iisTlsAttributes;
 
 
@@ -131,7 +131,7 @@ public class AjpProcessor extends AbstractProcessor {
 System.arraycopy(pongMessage.getBuffer(), 0, pongMessageArray, 0, 
pongMessage.getLen());
 
 // Build Map of Java Servlet to Jakarta Servlet attribute names
-Map m = new HashMap<>();
+Map m = new HashMap<>();
 m.put("jakarta.servlet.request.cipher_suite", 
"jakarta.servlet.request.cipher_suite");
 m.put("jakarta.servlet.request.key_size", 
"jakarta.servlet.request.key_size");
 m.put("jakarta.servlet.request.ssl_session", 
"jakarta.servlet.request.ssl_session");
@@ -991,8 +991,8 @@ public class AjpProcessor extends AbstractProcessor {
 responseMessage.appendBytes(hV);
 } catch (IllegalArgumentException iae) {
 // Log the problematic header
-
log.warn(sm.getString("ajpprocessor.response.invalidHeader", 
headers.getName(i), headers.getValue(i)),
-iae);
+
log.warn(sm.getString("ajpprocessor.response.invalidHeader", headers.getName(i),
+headers.getValue(i)), iae);
 // Remove the problematic header
 headers.removeHeader(i);
 numHeaders--;
diff --git a/java/org/apache/coyote/ajp/Constants.java 
b/java/org/apache/coyote/ajp/Constants.java
index f124d8ebcb..2e4e4de60b 100644
--- a/java/org/apache/coyote/ajp/Constants.java
+++ b/java/org/apache/coyote/ajp/Constants.java
@@ -104,10 +104,10 @@ public final class Constants {
 public static final int MAX_SEND_SIZE = MAX_PACKET_SIZE - SEND_HEAD_LEN;
 
 // Translates integer codes to names of HTTP methods
-private static final String[] methodTransArray = { "OPTIONS", "GET", 
"HEAD", "POST", "PUT", "DELETE", "TRACE",
-"PROPFIND", "PROPPATCH", "MKCOL", "COPY", "MOVE", "LOCK", 
"UNLOCK", "ACL", "REPORT", "VERSION-CONTROL",
-"CHECKIN", "CHECKOUT", "UNCHECKOUT", "SEARCH", "MKWORKSPACE", 
"UPDATE", "LABEL", "MERGE",
-"BASELINE-CONTROL", "MKACTIVITY" };
+private static final String[] methodTransArray =
+{ "OPTIONS", "GET", "HEAD", "POST", "PUT", "DELETE", "TRACE", 
"PROPFIND", "PROPPATCH", "MKCOL", "COPY",
+"MOVE", "LOCK", "UNLOCK", "ACL", "REPORT", 
"VERSION-CONTROL", "CHECKIN", "CHECKOUT", "UNCHECKOUT",
+"SEARCH", "MKWORKSPACE", "UPDATE", "LABEL", "MERGE", 
"BASELINE-CONTROL", "MKACTIVITY" };
 
 /**
  * Converts an AJP coded HTTP method to the method name.
@@ -139,9 +139,9 @@ public final class Constants {

(tomcat) branch 10.1.x updated: Code clean-up - formatting. No functional change

2024-05-24 Thread markt
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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new b473b6f6f4 Code clean-up - formatting. No functional change
b473b6f6f4 is described below

commit b473b6f6f4fd6f665958483609961691f6328795
Author: Mark Thomas 
AuthorDate: Fri May 24 13:22:26 2024 +0100

Code clean-up - formatting. No functional change
---
 .../catalina/valves/AbstractAccessLogValve.java| 14 +-
 .../valves/CrawlerSessionManagerValve.java | 10 +++
 .../catalina/valves/ExtendedAccessLogValve.java| 10 +++
 .../apache/catalina/valves/JsonAccessLogValve.java | 32 --
 .../catalina/valves/LoadBalancerDrainingValve.java |  4 +--
 .../apache/catalina/valves/PersistentValve.java| 11 
 java/org/apache/catalina/valves/RemoteIpValve.java |  4 +--
 .../org/apache/catalina/valves/SemaphoreValve.java |  3 +-
 .../catalina/valves/StuckThreadDetectionValve.java | 11 
 9 files changed, 51 insertions(+), 48 deletions(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index ac81d1184f..2b1b064ca8 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -362,7 +362,7 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 private final Locale cacheDefaultLocale;
 private final DateFormatCache parent;
 protected final Cache cLFCache;
-private final Map formatCache = new HashMap<>();
+private final Map formatCache = new HashMap<>();
 
 protected DateFormatCache(int size, Locale loc, DateFormatCache 
parent) {
 cacheSize = size;
@@ -409,14 +409,14 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 /**
  * Global date format cache.
  */
-private static final DateFormatCache globalDateCache = new 
DateFormatCache(globalCacheSize, Locale.getDefault(),
-null);
+private static final DateFormatCache globalDateCache =
+new DateFormatCache(globalCacheSize, Locale.getDefault(), null);
 
 /**
  * Thread local date format cache.
  */
-private static final ThreadLocal localDateCache = 
ThreadLocal
-.withInitial(() -> new DateFormatCache(localCacheSize, 
Locale.getDefault(), globalDateCache));
+private static final ThreadLocal localDateCache =
+ThreadLocal.withInitial(() -> new DateFormatCache(localCacheSize, 
Locale.getDefault(), globalDateCache));
 
 
 /**
@@ -1341,7 +1341,7 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 /**
  * Append the time to the buffer in the appropriate format.
  *
- * @param buf The buffer to append to.
+ * @param buf  The buffer to append to.
  * @param time The time to log in nanoseconds.
  */
 public abstract void append(CharArrayWriter buf, long time);
@@ -1917,7 +1917,7 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 // is encountered plus at the end.
 default:
 }
-// Control (1-31), delete (127) or above 127
+// Control (1-31), delete (127) or above 127
 } else {
 // Write unchanged string parts
 if (current > next) {
diff --git a/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java 
b/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java
index 21f032847f..491fcb17fd 100644
--- a/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java
+++ b/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java
@@ -45,8 +45,8 @@ public class CrawlerSessionManagerValve extends ValveBase {
 
 private static final Log log = 
LogFactory.getLog(CrawlerSessionManagerValve.class);
 
-private final Map clientIdSessionId = new 
ConcurrentHashMap<>();
-private final Map sessionIdClientId = new 
ConcurrentHashMap<>();
+private final Map clientIdSessionId = new 
ConcurrentHashMap<>();
+private final Map sessionIdClientId = new 
ConcurrentHashMap<>();
 
 private String crawlerUserAgents = ".*[bB]ot.*|.*Yahoo! 
Slurp.*|.*Feedfetcher-Google.*";
 private Pattern uaPattern = null;
@@ -139,7 +139,7 @@ public class CrawlerSessionManagerValve extends ValveBase {
 }
 
 
-public Map getClientIpSessionId() {
+public Map getClientIpSessionId() {
 return clientIdSessionId;
 }
 
@@ -272,10 +272,10 @@ public class CrawlerSessionManagerValve extends ValveBase 
{
 private static class CrawlerHttpSessionBindingListener implements 
HttpSessionBindingL

(tomcat) branch 10.1.x updated: Code clean-up - formatting. No functional change

2024-05-14 Thread markt
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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new cea7ced1c6 Code clean-up - formatting. No functional change
cea7ced1c6 is described below

commit cea7ced1c670e93073a7e8c8b370147788bfb338
Author: Mark Thomas 
AuthorDate: Tue May 14 11:00:40 2024 +0100

Code clean-up - formatting. No functional change
---
 java/org/apache/catalina/users/AbstractGroup.java  |  5 +-
 java/org/apache/catalina/users/AbstractRole.java   |  5 +-
 java/org/apache/catalina/users/AbstractUser.java   |  5 +-
 java/org/apache/catalina/users/Constants.java  |  2 +-
 .../catalina/users/DataSourceUserDatabase.java | 49 +--
 .../users/DataSourceUserDatabaseFactory.java   | 48 ++-
 java/org/apache/catalina/users/GenericGroup.java   | 17 ++--
 java/org/apache/catalina/users/GenericRole.java| 15 ++--
 java/org/apache/catalina/users/GenericUser.java| 16 ++--
 java/org/apache/catalina/users/MemoryGroup.java| 22 +++--
 java/org/apache/catalina/users/MemoryRole.java | 22 +++--
 java/org/apache/catalina/users/MemoryUser.java | 30 ---
 .../apache/catalina/users/MemoryUserDatabase.java  | 96 +-
 .../catalina/users/MemoryUserDatabaseFactory.java  | 52 ++--
 14 files changed, 193 insertions(+), 191 deletions(-)

diff --git a/java/org/apache/catalina/users/AbstractGroup.java 
b/java/org/apache/catalina/users/AbstractGroup.java
index 0430b65f33..8d4e4f74cd 100644
--- a/java/org/apache/catalina/users/AbstractGroup.java
+++ b/java/org/apache/catalina/users/AbstractGroup.java
@@ -21,9 +21,12 @@ import org.apache.catalina.Group;
 
 
 /**
- * Convenience base class for {@link Group} implementations.
+ * 
+ * Convenience base class for {@link Group} implementations.
+ * 
  *
  * @author Craig R. McClanahan
+ *
  * @since 4.1
  */
 public abstract class AbstractGroup implements Group {
diff --git a/java/org/apache/catalina/users/AbstractRole.java 
b/java/org/apache/catalina/users/AbstractRole.java
index 7de9d545aa..610aedde73 100644
--- a/java/org/apache/catalina/users/AbstractRole.java
+++ b/java/org/apache/catalina/users/AbstractRole.java
@@ -21,9 +21,12 @@ import org.apache.catalina.Role;
 
 
 /**
- * Convenience base class for {@link Role} implementations.
+ * 
+ * Convenience base class for {@link Role} implementations.
+ * 
  *
  * @author Craig R. McClanahan
+ *
  * @since 4.1
  */
 public abstract class AbstractRole implements Role {
diff --git a/java/org/apache/catalina/users/AbstractUser.java 
b/java/org/apache/catalina/users/AbstractUser.java
index 7ff6752f62..a00ead6c80 100644
--- a/java/org/apache/catalina/users/AbstractUser.java
+++ b/java/org/apache/catalina/users/AbstractUser.java
@@ -21,9 +21,12 @@ import org.apache.catalina.User;
 
 
 /**
- * Convenience base class for {@link User} implementations.
+ * 
+ * Convenience base class for {@link User} implementations.
+ * 
  *
  * @author Craig R. McClanahan
+ *
  * @since 4.1
  */
 public abstract class AbstractUser implements User {
diff --git a/java/org/apache/catalina/users/Constants.java 
b/java/org/apache/catalina/users/Constants.java
index c79f517a7b..df7e150ca8 100644
--- a/java/org/apache/catalina/users/Constants.java
+++ b/java/org/apache/catalina/users/Constants.java
@@ -20,8 +20,8 @@ package org.apache.catalina.users;
 /**
  * Manifest constants for this Java package.
  *
- *
  * @author Craig R. McClanahan
+ *
  * @since 4.1
  */
 public final class Constants {
diff --git a/java/org/apache/catalina/users/DataSourceUserDatabase.java 
b/java/org/apache/catalina/users/DataSourceUserDatabase.java
index 8ad9aa7a7f..99b4c2fe59 100644
--- a/java/org/apache/catalina/users/DataSourceUserDatabase.java
+++ b/java/org/apache/catalina/users/DataSourceUserDatabase.java
@@ -61,17 +61,17 @@ public class DataSourceUserDatabase extends 
SparseUserDatabase {
  */
 protected final String id;
 
-protected final ConcurrentHashMap createdUsers = new 
ConcurrentHashMap<>();
-protected final ConcurrentHashMap modifiedUsers = new 
ConcurrentHashMap<>();
-protected final ConcurrentHashMap removedUsers = new 
ConcurrentHashMap<>();
+protected final ConcurrentHashMap createdUsers = new 
ConcurrentHashMap<>();
+protected final ConcurrentHashMap modifiedUsers = new 
ConcurrentHashMap<>();
+protected final ConcurrentHashMap removedUsers = new 
ConcurrentHashMap<>();
 
-protected final ConcurrentHashMap createdGroups = new 
ConcurrentHashMap<>();
-protected final ConcurrentHashMap modifiedGroups = new 
ConcurrentHashMap<>();
-protected final ConcurrentHashMap removedGroups = new 
ConcurrentHashMap<>();
+protected final ConcurrentHashMap createdGroups = new 
ConcurrentHashMap<>();
+protected final ConcurrentHashMap modifiedGroups = new 
ConcurrentHashMap<>();
+protected final Concur

(tomcat) branch 10.1.x updated: Code clean-up - formatting. No functional change

2024-05-10 Thread markt
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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new fa0e97e9fd Code clean-up - formatting. No functional change
fa0e97e9fd is described below

commit fa0e97e9fdc62fd90320869e9fa51c40dead3d0c
Author: Mark Thomas 
AuthorDate: Fri May 10 14:59:18 2024 +0100

Code clean-up - formatting. No functional change
---
 .../catalina/tribes/transport/AbstractRxTask.java  |   3 +-
 .../catalina/tribes/transport/AbstractSender.java  |  15 +-
 .../catalina/tribes/transport/Constants.java   |   8 +-
 .../catalina/tribes/transport/DataSender.java  |   7 +
 .../tribes/transport/MultiPointSender.java |   9 +-
 .../catalina/tribes/transport/PooledSender.java|  51 ++---
 .../catalina/tribes/transport/ReceiverBase.java|  66 ---
 .../tribes/transport/ReplicationTransmitter.java   |  11 +-
 .../catalina/tribes/transport/RxTaskPool.java  |  48 ++---
 .../catalina/tribes/transport/SenderState.java |   6 +-
 .../catalina/tribes/transport/nio/NioReceiver.java | 196 +--
 .../tribes/transport/nio/NioReplicationTask.java   | 212 ++---
 .../catalina/tribes/transport/nio/NioSender.java   | 195 +--
 .../tribes/transport/nio/ParallelNioSender.java| 141 +++---
 .../tribes/transport/nio/PooledParallelSender.java |  16 +-
 15 files changed, 502 insertions(+), 482 deletions(-)

diff --git a/java/org/apache/catalina/tribes/transport/AbstractRxTask.java 
b/java/org/apache/catalina/tribes/transport/AbstractRxTask.java
index 2a95f7dd53..2d17ae166b 100644
--- a/java/org/apache/catalina/tribes/transport/AbstractRxTask.java
+++ b/java/org/apache/catalina/tribes/transport/AbstractRxTask.java
@@ -18,8 +18,7 @@ package org.apache.catalina.tribes.transport;
 
 import org.apache.catalina.tribes.io.ListenCallback;
 
-public abstract class AbstractRxTask implements Runnable
-{
+public abstract class AbstractRxTask implements Runnable {
 
 public static final int OPTION_DIRECT_BUFFER = 
ReceiverBase.OPTION_DIRECT_BUFFER;
 
diff --git a/java/org/apache/catalina/tribes/transport/AbstractSender.java 
b/java/org/apache/catalina/tribes/transport/AbstractSender.java
index ba17303123..f3b7a0a563 100644
--- a/java/org/apache/catalina/tribes/transport/AbstractSender.java
+++ b/java/org/apache/catalina/tribes/transport/AbstractSender.java
@@ -37,7 +37,7 @@ public abstract class AbstractSender implements DataSender {
 private Member destination;
 private InetAddress address;
 private int port;
-private int maxRetryAttempts = 1;//1 resends
+private int maxRetryAttempts = 1;// 1 resends
 private int attempt;
 private boolean tcpNoDelay = true;
 private boolean soKeepAlive = false;
@@ -52,8 +52,9 @@ public abstract class AbstractSender implements DataSender {
 
 /**
  * transfers sender properties from one sender to another
+ *
  * @param from AbstractSender
- * @param to AbstractSender
+ * @param to   AbstractSender
  */
 public static void transferProperties(AbstractSender from, AbstractSender 
to) {
 to.rxBufSize = from.rxBufSize;
@@ -87,19 +88,19 @@ public abstract class AbstractSender implements DataSender {
 public boolean keepalive() {
 boolean disconnect = false;
 if (isUdpBased()) {
-disconnect = true; //always disconnect UDP, TODO optimize the 
keepalive handling
-} else if ( keepAliveCount >= 0 && requestCount>keepAliveCount ) {
+disconnect = true; // always disconnect UDP, TODO optimize the 
keepalive handling
+} else if (keepAliveCount >= 0 && requestCount > keepAliveCount) {
 disconnect = true;
-} else if ( keepAliveTime >= 0 && 
(System.currentTimeMillis()-connectTime)>keepAliveTime ) {
+} else if (keepAliveTime >= 0 && (System.currentTimeMillis() - 
connectTime) > keepAliveTime) {
 disconnect = true;
 }
-if ( disconnect ) {
+if (disconnect) {
 disconnect();
 }
 return disconnect;
 }
 
-protected void setConnected(boolean connected){
+protected void setConnected(boolean connected) {
 this.connected = connected;
 }
 
diff --git a/java/org/apache/catalina/tribes/transport/Constants.java 
b/java/org/apache/catalina/tribes/transport/Constants.java
index 07946d826e..46983a493d 100644
--- a/java/org/apache/catalina/tribes/transport/Constants.java
+++ b/java/org/apache/catalina/tribes/transport/Constants.java
@@ -19,8 +19,8 @@ package org.apache.catalina.tribes.transport;
 import org.apache.catalina.tribes.io.XByteBuffer;
 
 /**
- * Manifest constants for the org.apache.catalina.tribes.transport
- * package.
+ * Manifest constants for the 
org.apache.catalina.tribes.transport package.
+ *
  * @author Peter Rossbach
  */
 publi

(tomcat) branch 10.1.x updated: Code clean-up. Formatting. No functional change.

2024-01-15 Thread markt
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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 62354dc8ac Code clean-up. Formatting. No functional change.
62354dc8ac is described below

commit 62354dc8acb25e73842865df5344b4967141
Author: Mark Thomas 
AuthorDate: Mon Jan 15 13:11:19 2024 +

Code clean-up. Formatting. No functional change.
---
 .../catalina/ssi/ByteArrayServletOutputStream.java |   4 +-
 .../apache/catalina/ssi/ExpressionParseTree.java   |  75 +
 .../apache/catalina/ssi/ExpressionTokenizer.java   |  39 +++--
 .../catalina/ssi/ResponseIncludeWrapper.java   |  45 +++---
 java/org/apache/catalina/ssi/SSICommand.java   |  29 ++--
 java/org/apache/catalina/ssi/SSIConditional.java   |  25 ++-
 .../apache/catalina/ssi/SSIConditionalState.java   |  11 +-
 java/org/apache/catalina/ssi/SSIConfig.java|  15 +-
 java/org/apache/catalina/ssi/SSIEcho.java  |  15 +-
 java/org/apache/catalina/ssi/SSIExec.java  |  16 +-
 .../apache/catalina/ssi/SSIExternalResolver.java   |  26 ++--
 java/org/apache/catalina/ssi/SSIFilter.java|  42 ++---
 java/org/apache/catalina/ssi/SSIFlastmod.java  |  14 +-
 java/org/apache/catalina/ssi/SSIFsize.java |  22 ++-
 java/org/apache/catalina/ssi/SSIInclude.java   |  18 +--
 java/org/apache/catalina/ssi/SSIMediator.java  |  80 --
 java/org/apache/catalina/ssi/SSIPrintenv.java  |   8 +-
 java/org/apache/catalina/ssi/SSIProcessor.java | 113 ++
 java/org/apache/catalina/ssi/SSIServlet.java   |  86 ---
 .../catalina/ssi/SSIServletExternalResolver.java   | 171 +
 .../apache/catalina/ssi/SSIServletRequestUtil.java |  18 +--
 java/org/apache/catalina/ssi/SSISet.java   |  13 +-
 .../catalina/ssi/SSIStopProcessingException.java   |   5 +-
 23 files changed, 379 insertions(+), 511 deletions(-)

diff --git a/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java 
b/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java
index 4f1f8d7039..aa713db084 100644
--- a/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java
+++ b/java/org/apache/catalina/ssi/ByteArrayServletOutputStream.java
@@ -23,10 +23,10 @@ import jakarta.servlet.WriteListener;
 
 
 /**
- * Class that extends ServletOutputStream, used as a wrapper from within
- * SsiInclude
+ * Class that extends ServletOutputStream, used as a wrapper from within 
SsiInclude
  *
  * @author Bip Thelin
+ *
  * @see ServletOutputStream and ByteArrayOutputStream
  */
 public class ByteArrayServletOutputStream extends ServletOutputStream {
diff --git a/java/org/apache/catalina/ssi/ExpressionParseTree.java 
b/java/org/apache/catalina/ssi/ExpressionParseTree.java
index ce535d268e..af181050e3 100644
--- a/java/org/apache/catalina/ssi/ExpressionParseTree.java
+++ b/java/org/apache/catalina/ssi/ExpressionParseTree.java
@@ -26,6 +26,7 @@ import java.util.regex.PatternSyntaxException;
 
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.res.StringManager;
+
 /**
  * Represents a parsed expression.
  *
@@ -34,13 +35,13 @@ import org.apache.tomcat.util.res.StringManager;
 public class ExpressionParseTree {
 private static final StringManager sm = 
StringManager.getManager(ExpressionParseTree.class);
 /**
- * Contains the current set of completed nodes. This is a workspace for the
- * parser. Needs to be LinkedList since it can contain {@code null}s.
+ * Contains the current set of completed nodes. This is a workspace for 
the parser. Needs to be LinkedList since it
+ * can contain {@code null}s.
  */
 private final LinkedList nodeStack = new LinkedList<>();
 /**
- * Contains operator nodes that don't yet have values. This is a workspace
- * for the parser. Needs to be LinkedList since it can contain {@code 
null}s.
+ * Contains operator nodes that don't yet have values. This is a workspace 
for the parser. Needs to be LinkedList
+ * since it can contain {@code null}s.
  */
 private final LinkedList oppStack = new LinkedList<>();
 /**
@@ -55,20 +56,20 @@ public class ExpressionParseTree {
 
 /**
  * Creates a new parse tree for the specified expression.
- * @param expr The expression string
+ *
+ * @param exprThe expression string
  * @param ssiMediator Used to evaluated the expressions
+ *
  * @throws ParseException a parsing error occurred
  */
-public ExpressionParseTree(String expr, SSIMediator ssiMediator)
-throws ParseException {
+public ExpressionParseTree(String expr, SSIMediator ssiMediator) throws 
ParseException {
 this.ssiMediator = ssiMediator;
 parseExpression(expr);
 }
 
 
 /**
- * Evaluates the tree and returns true or false. The specified SSIMe

[tomcat] branch 10.1.x updated: Code clean-up - formatting. No functional change.

2023-07-04 Thread markt
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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 146e7f2fda Code clean-up - formatting. No functional change.
146e7f2fda is described below

commit 146e7f2fda19a0633ae8b10be910893ec615990e
Author: Mark Thomas 
AuthorDate: Tue Jul 4 12:31:25 2023 +0100

Code clean-up - formatting. No functional change.
---
 java/org/apache/catalina/filters/Constants.java|  3 +-
 java/org/apache/catalina/filters/CorsFilter.java   | 12 
 .../catalina/filters/CsrfPreventionFilter.java |  8 ++---
 .../catalina/filters/CsrfPreventionFilterBase.java |  4 +--
 .../org/apache/catalina/filters/ExpiresFilter.java | 34 +-
 .../catalina/filters/HttpHeaderSecurityFilter.java |  4 ++-
 .../apache/catalina/filters/RateLimitFilter.java   |  4 +--
 .../apache/catalina/filters/RemoteIpFilter.java| 22 +++---
 .../catalina/filters/RestCsrfPreventionFilter.java | 15 +-
 9 files changed, 58 insertions(+), 48 deletions(-)

diff --git a/java/org/apache/catalina/filters/Constants.java 
b/java/org/apache/catalina/filters/Constants.java
index 25693aef56..dbec2a72cc 100644
--- a/java/org/apache/catalina/filters/Constants.java
+++ b/java/org/apache/catalina/filters/Constants.java
@@ -60,5 +60,6 @@ public final class Constants {
 /**
  * The servlet context attribute key under which the CSRF REST header name 
can be found.
  */
-public static final String CSRF_REST_NONCE_HEADER_NAME_KEY = 
"org.apache.catalina.filters.CSRF_REST_NONCE_HEADER_NAME";
+public static final String CSRF_REST_NONCE_HEADER_NAME_KEY =
+"org.apache.catalina.filters.CSRF_REST_NONCE_HEADER_NAME";
 }
diff --git a/java/org/apache/catalina/filters/CorsFilter.java 
b/java/org/apache/catalina/filters/CorsFilter.java
index 74314ba6b8..2760635f04 100644
--- a/java/org/apache/catalina/filters/CorsFilter.java
+++ b/java/org/apache/catalina/filters/CorsFilter.java
@@ -276,8 +276,8 @@ public class CorsFilter extends GenericFilter {
 }
 
 // Section 6.2.4
-String accessControlRequestHeadersHeader = request
-
.getHeader(CorsFilter.REQUEST_HEADER_ACCESS_CONTROL_REQUEST_HEADERS);
+String accessControlRequestHeadersHeader =
+
request.getHeader(CorsFilter.REQUEST_HEADER_ACCESS_CONTROL_REQUEST_HEADERS);
 List accessControlRequestHeaders = new ArrayList<>();
 if (accessControlRequestHeadersHeader != null && 
!accessControlRequestHeadersHeader.trim().isEmpty()) {
 String[] headers = 
accessControlRequestHeadersHeader.trim().split(",");
@@ -563,8 +563,8 @@ public class CorsFilter extends GenericFilter {
 String method = request.getMethod();
 if (method != null) {
 if ("OPTIONS".equals(method)) {
-String accessControlRequestMethodHeader = request
-
.getHeader(REQUEST_HEADER_ACCESS_CONTROL_REQUEST_METHOD);
+String accessControlRequestMethodHeader =
+
request.getHeader(REQUEST_HEADER_ACCESS_CONTROL_REQUEST_METHOD);
 if (accessControlRequestMethodHeader != null && 
!accessControlRequestMethodHeader.isEmpty()) {
 requestType = CORSRequestType.PRE_FLIGHT;
 } else if (accessControlRequestMethodHeader != null &&
@@ -894,8 +894,8 @@ public class CorsFilter extends GenericFilter {
 /**
  * Request headers sent as 'Access-Control-Request-Headers' header, for 
pre-flight request.
  */
-public static final String HTTP_REQUEST_ATTRIBUTE_REQUEST_HEADERS = 
HTTP_REQUEST_ATTRIBUTE_PREFIX +
-"request.headers";
+public static final String HTTP_REQUEST_ATTRIBUTE_REQUEST_HEADERS =
+HTTP_REQUEST_ATTRIBUTE_PREFIX + "request.headers";
 
 // -- Constants
 /**
diff --git a/java/org/apache/catalina/filters/CsrfPreventionFilter.java 
b/java/org/apache/catalina/filters/CsrfPreventionFilter.java
index 28769a0b59..d33fdb8d08 100644
--- a/java/org/apache/catalina/filters/CsrfPreventionFilter.java
+++ b/java/org/apache/catalina/filters/CsrfPreventionFilter.java
@@ -258,8 +258,8 @@ public class CsrfPreventionFilter extends 
CsrfPreventionFilterBase {
 return null;
 }
 @SuppressWarnings("unchecked")
-NonceCache nonceCache = (NonceCache) session
-.getAttribute(Constants.CSRF_NONCE_SESSION_ATTR_NAME);
+NonceCache nonceCache =
+(NonceCache) 
session.getAttribute(Constants.CSRF_NONCE_SESSION_ATTR_NAME);
 return nonceCache;
 }
 
@@ -343,14 +343,14 @@ public class CsrfPreventionFilter extends 
CsrfPreventionFilterBase {
 
 // 

[tomcat] branch 10.1.x updated: Code clean-up - formatting. No functional change.

2023-06-01 Thread markt
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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new d50b0df47b Code clean-up - formatting. No functional change.
d50b0df47b is described below

commit d50b0df47b08bf043b65d51298bc6c13a5c4
Author: Mark Thomas 
AuthorDate: Thu Jun 1 19:45:30 2023 +0100

Code clean-up - formatting. No functional change.
---
 .../apache/catalina/connector/CoyoteAdapter.java   |  4 +--
 .../org/apache/catalina/connector/InputBuffer.java |  2 +-
 .../apache/catalina/connector/OutputBuffer.java|  2 +-
 java/org/apache/catalina/connector/Request.java| 38 +++---
 .../apache/catalina/connector/RequestFacade.java   |  8 ++---
 java/org/apache/catalina/connector/Response.java   |  8 ++---
 .../apache/catalina/connector/ResponseFacade.java  |  4 +--
 7 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java 
b/java/org/apache/catalina/connector/CoyoteAdapter.java
index 40edce0b11..4242f34fc0 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -917,8 +917,8 @@ public class CoyoteAdapter implements Adapter {
 int end = uriBC.getEnd();
 
 int pathParamStart = semicolon + 1;
-int pathParamEnd = ByteChunk.findBytes(uriBC.getBuffer(), start + 
pathParamStart, end,
-new byte[] { ';', '/' });
+int pathParamEnd =
+ByteChunk.findBytes(uriBC.getBuffer(), start + 
pathParamStart, end, new byte[] { ';', '/' });
 
 String pv = null;
 
diff --git a/java/org/apache/catalina/connector/InputBuffer.java 
b/java/org/apache/catalina/connector/InputBuffer.java
index 1e1967b715..3bffaf74d1 100644
--- a/java/org/apache/catalina/connector/InputBuffer.java
+++ b/java/org/apache/catalina/connector/InputBuffer.java
@@ -69,7 +69,7 @@ public class InputBuffer extends Reader implements 
ByteChunk.ByteInputChannel, A
 /**
  * Encoder cache.
  */
-private static final Map> 
encoders = new ConcurrentHashMap<>();
+private static final Map> encoders 
= new ConcurrentHashMap<>();
 
 // - Instance Variables
 
diff --git a/java/org/apache/catalina/connector/OutputBuffer.java 
b/java/org/apache/catalina/connector/OutputBuffer.java
index 62966c653b..fbc638bf05 100644
--- a/java/org/apache/catalina/connector/OutputBuffer.java
+++ b/java/org/apache/catalina/connector/OutputBuffer.java
@@ -55,7 +55,7 @@ public class OutputBuffer extends Writer {
 /**
  * Encoder cache.
  */
-private final Map encoders = new HashMap<>();
+private final Map encoders = new HashMap<>();
 
 
 /**
diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index 879651f58b..a607dd08c0 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -194,7 +194,7 @@ public class Request implements HttpServletRequest {
 /**
  * The attributes associated with this Request, keyed by attribute name.
  */
-private final Map attributes = new ConcurrentHashMap<>();
+private final Map attributes = new ConcurrentHashMap<>();
 
 
 /**
@@ -213,7 +213,7 @@ public class Request implements HttpServletRequest {
 /**
  * Internal notes associated with this request by Catalina components and 
event listeners.
  */
-private final transient HashMap notes = new HashMap<>();
+private final transient HashMap notes = new HashMap<>();
 
 
 /**
@@ -304,7 +304,7 @@ public class Request implements HttpServletRequest {
 /**
  * Hash map used in the getParametersMap method.
  */
-protected ParameterMap parameterMap = new 
ParameterMap<>();
+protected ParameterMap parameterMap = new 
ParameterMap<>();
 
 
 /**
@@ -1100,7 +1100,7 @@ public class Request implements HttpServletRequest {
  * @return A Map containing parameter names as keys and 
parameter values as map values.
  */
 @Override
-public Map getParameterMap() {
+public Map getParameterMap() {
 
 if (parameterMap.isLocked()) {
 return parameterMap;
@@ -1549,8 +1549,8 @@ public class Request implements HttpServletRequest {
 if ((listeners == null) || (listeners.length == 0)) {
 return;
 }
-ServletRequestAttributeEvent event = new 
ServletRequestAttributeEvent(context.getServletContext(), getRequest(),
-name, value);
+ServletRequestAttributeEvent event =
+new ServletRequestAttributeEvent(context.getServletContext(), 
getRequest(), name, value);
 for (Object o : listeners) {
 if (!(o instanceof ServletRequestAttr

[tomcat] branch 10.1.x updated: Code clean-up. Formatting. No functional change.

2023-05-23 Thread markt
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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new d63d73730e Code clean-up. Formatting. No functional change.
d63d73730e is described below

commit d63d73730ecc789aff792afbeaea5963ef4b7319
Author: Mark Thomas 
AuthorDate: Tue May 23 11:23:14 2023 +0100

Code clean-up. Formatting. No functional change.
---
 .../catalina/authenticator/AuthenticatorBase.java  |  12 +--
 .../authenticator/DigestAuthenticator.java |  25 ++---
 .../catalina/authenticator/SavedRequest.java   |   2 +-
 .../catalina/authenticator/SingleSignOn.java   |   2 +-
 .../catalina/authenticator/SingleSignOnEntry.java  |   6 +-
 .../authenticator/SpnegoAuthenticator.java |   2 +-
 .../jaspic/AuthConfigFactoryImpl.java  | 107 +
 .../authenticator/jaspic/CallbackHandlerImpl.java  |  11 +--
 .../authenticator/jaspic/MessageInfoImpl.java  |  10 +-
 .../jaspic/PersistentProviderRegistrations.java|  34 ---
 .../jaspic/SimpleAuthConfigProvider.java   |  18 ++--
 .../jaspic/SimpleServerAuthConfig.java |  17 ++--
 .../jaspic/SimpleServerAuthContext.java|  14 ++-
 13 files changed, 119 insertions(+), 141 deletions(-)

diff --git a/java/org/apache/catalina/authenticator/AuthenticatorBase.java 
b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
index e53ffc7297..352f984c79 100644
--- a/java/org/apache/catalina/authenticator/AuthenticatorBase.java
+++ b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
@@ -612,8 +612,8 @@ public abstract class AuthenticatorBase extends ValveBase 
implements Authenticat
 String originHeader = 
request.getHeader(CorsFilter.REQUEST_HEADER_ORIGIN);
 if (originHeader != null && !originHeader.isEmpty() && 
RequestUtil.isValidOrigin(originHeader) &&
 !RequestUtil.isSameOrigin(request, originHeader)) {
-String accessControlRequestMethodHeader = request
-
.getHeader(CorsFilter.REQUEST_HEADER_ACCESS_CONTROL_REQUEST_METHOD);
+String accessControlRequestMethodHeader =
+
request.getHeader(CorsFilter.REQUEST_HEADER_ACCESS_CONTROL_REQUEST_METHOD);
 if (accessControlRequestMethodHeader != null && 
!accessControlRequestMethodHeader.isEmpty()) {
 // This appears to be a CORS Preflight request
 if (allowCorsPreflight == AllowCorsPreflight.ALWAYS) {
@@ -699,8 +699,8 @@ public abstract class AuthenticatorBase extends ValveBase 
implements Authenticat
 
 try {
 CallbackHandler callbackHandler = getCallbackHandler();
-ServerAuthConfig serverAuthConfig = 
jaspicProvider.getServerAuthConfig("HttpServlet", jaspicAppContextID,
-callbackHandler);
+ServerAuthConfig serverAuthConfig =
+jaspicProvider.getServerAuthConfig("HttpServlet", 
jaspicAppContextID, callbackHandler);
 String authContextID = 
serverAuthConfig.getAuthContextID(jaspicState.messageInfo);
 jaspicState.serverAuthContext = 
serverAuthConfig.getAuthContext(authContextID, null, null);
 } catch (AuthException e) {
@@ -1171,8 +1171,8 @@ public abstract class AuthenticatorBase extends ValveBase 
implements Authenticat
 if (client != null) {
 ServerAuthContext serverAuthContext;
 try {
-ServerAuthConfig serverAuthConfig = 
provider.getServerAuthConfig("HttpServlet", jaspicAppContextID,
-getCallbackHandler());
+ServerAuthConfig serverAuthConfig =
+provider.getServerAuthConfig("HttpServlet", 
jaspicAppContextID, getCallbackHandler());
 String authContextID = 
serverAuthConfig.getAuthContextID(messageInfo);
 serverAuthContext = 
serverAuthConfig.getAuthContext(authContextID, null, null);
 serverAuthContext.cleanSubject(messageInfo, client);
diff --git a/java/org/apache/catalina/authenticator/DigestAuthenticator.java 
b/java/org/apache/catalina/authenticator/DigestAuthenticator.java
index d65eda065d..4df6d12e06 100644
--- a/java/org/apache/catalina/authenticator/DigestAuthenticator.java
+++ b/java/org/apache/catalina/authenticator/DigestAuthenticator.java
@@ -68,7 +68,7 @@ public class DigestAuthenticator extends AuthenticatorBase {
 private static final String NONCE_DIGEST = "SHA-256";
 
 // List permitted algorithms and maps them to Java standard names
-private static final Map PERMITTED_ALGORITHMS = new 
HashMap<>();
+private static final Map PERMITTED_ALGORITHMS = new 
HashMap<>();
 static {
 // Allows the digester

[tomcat] branch 10.1.x updated: Code clean-up - formatting. No functional change.

2023-05-10 Thread markt
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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new b47ac43da6 Code clean-up - formatting. No functional change.
b47ac43da6 is described below

commit b47ac43da6a7bdea27e3319816906fd22cd574f9
Author: Mark Thomas 
AuthorDate: Wed May 10 17:05:01 2023 +0100

Code clean-up - formatting. No functional change.
---
 java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java 
b/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java
index 4f8aa81b46..f0dd05f482 100644
--- a/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java
+++ b/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java
@@ -154,10 +154,7 @@ public class JMXAccessorQueryTask extends JMXAccessorTask {
 }
 continue;
 }
-if (value == null) {
-continue;
-}
-if ("modelerType".equals(attName)) {
+if ((value == null) || "modelerType".equals(attName)) {
 continue;
 }
 createProperty(pname + attName, value);


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



[tomcat] branch 10.1.x updated: Code clean-up. Formatting. No functional change.

2023-03-15 Thread markt
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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new f32bf1dbf4 Code clean-up. Formatting. No functional change.
f32bf1dbf4 is described below

commit f32bf1dbf4e23c58b199ee8ac7048f397e60da56
Author: Mark Thomas 
AuthorDate: Wed Mar 15 14:10:29 2023 +

Code clean-up. Formatting. No functional change.
---
 .../catalina/tribes/demos/ChannelCreator.java  |  88 +++---
 .../catalina/tribes/demos/CoordinationDemo.java| 238 
 .../apache/catalina/tribes/demos/EchoRpcTest.java  | 232 
 .../catalina/tribes/demos/IntrospectionUtils.java  |  67 ++---
 .../org/apache/catalina/tribes/demos/LoadTest.java | 217 +++
 test/org/apache/catalina/tribes/demos/MapDemo.java | 302 ++---
 .../tribes/demos/MembersWithProperties.java|  45 ++-
 7 files changed, 581 insertions(+), 608 deletions(-)

diff --git a/test/org/apache/catalina/tribes/demos/ChannelCreator.java 
b/test/org/apache/catalina/tribes/demos/ChannelCreator.java
index 43cebc05ab..472cd6fe47 100644
--- a/test/org/apache/catalina/tribes/demos/ChannelCreator.java
+++ b/test/org/apache/catalina/tribes/demos/ChannelCreator.java
@@ -42,31 +42,20 @@ public class ChannelCreator {
 
 public static StringBuilder usage() {
 StringBuilder buf = new StringBuilder();
-buf.append("\n\t\t[-bind tcpbindaddress]")
-   .append("\n\t\t[-tcpselto tcpselectortimeout]")
-   .append("\n\t\t[-tcpthreads tcpthreadcount]")
-   .append("\n\t\t[-port tcplistenport]")
-   .append("\n\t\t[-autobind tcpbindtryrange]")
-   .append("\n\t\t[-ackto acktimeout]")
-   .append("\n\t\t[-receiver 
org.apache.catalina.tribes.transport.nio.NioReceiver|org.apache.catalina.tribes.transport.bio.BioReceiver|]")
-   .append("\n\t\t[-transport 
org.apache.catalina.tribes.transport.nio.PooledParallelSender|org.apache.catalina.tribes.transport.bio.PooledMultiSender]")
-   .append("\n\t\t[-transport.xxx transport specific property]")
-   .append("\n\t\t[-maddr multicastaddr]")
-   .append("\n\t\t[-mport multicastport]")
-   .append("\n\t\t[-mbind multicastbindaddr]")
-   .append("\n\t\t[-mfreq multicastfrequency]")
-   .append("\n\t\t[-mdrop multicastdroptime]")
-   .append("\n\t\t[-gzip]")
-   .append("\n\t\t[-static hostname:port (-static localhost: 
-static 127.0.0.1: can be repeated)]")
-   .append("\n\t\t[-order]")
-   .append("\n\t\t[-ordersize maxorderqueuesize]")
-   .append("\n\t\t[-frag]")
-   .append("\n\t\t[-fragsize maxmsgsize]")
-   .append("\n\t\t[-throughput]")
-   .append("\n\t\t[-failuredetect]")
-   .append("\n\t\t[-async]")
-   .append("\n\t\t[-asyncsize maxqueuesizeinkilobytes]");
-   return buf;
+buf.append("\n\t\t[-bind tcpbindaddress]").append("\n\t\t[-tcpselto 
tcpselectortimeout]")
+.append("\n\t\t[-tcpthreads 
tcpthreadcount]").append("\n\t\t[-port tcplistenport]")
+.append("\n\t\t[-autobind 
tcpbindtryrange]").append("\n\t\t[-ackto acktimeout]")
+.append("\n\t\t[-receiver 
org.apache.catalina.tribes.transport.nio.NioReceiver|org.apache.catalina.tribes.transport.bio.BioReceiver|]")
+.append("\n\t\t[-transport 
org.apache.catalina.tribes.transport.nio.PooledParallelSender|org.apache.catalina.tribes.transport.bio.PooledMultiSender]")
+.append("\n\t\t[-transport.xxx transport specific 
property]").append("\n\t\t[-maddr multicastaddr]")
+.append("\n\t\t[-mport multicastport]").append("\n\t\t[-mbind 
multicastbindaddr]")
+.append("\n\t\t[-mfreq 
multicastfrequency]").append("\n\t\t[-mdrop multicastdroptime]")
+.append("\n\t\t[-gzip]")
+.append("\n\t\t[-static hostname:port (-static localhost: 
-static 127.0.0.1: can be repeated)]")
+.append("\n\t\t[-order]").append("\n\t\t[-ordersize 
maxorderqueuesize]").append("\n\t\t[-frag]")
+.append("\n\t\t[-fragsize 
maxmsgsize]").append("\n\t\t[-throughput]").append("\n\t\t[-failuredetect]")
+.append("\n\t\t[-async]").append("\n\t\t[-asyncsize 
maxqueuesizeinkilobytes]");
+return buf;
 
 }
 
@@ -92,7 +81,7 @@ public class ChannelCreator {
 String transport = 
"org.apache.catalina.tribes.transport.nio.PooledParallelSender";
 String receiver = 
"org.apache.catalina.tribes.transport.nio.NioReceiver";
 boolean async = false;
-int asyncsize = 1024*1024*50; //50MB
+int asyncsize = 1024 * 1024 * 50; // 50MB
 boolean throughput = false;
 boolean failuredetect = false;
 
@@ -115,12 +104,12 @@ public class Chan

[tomcat] branch 10.1.x updated: Code clean-up. Formatting. No functional change.

2023-03-08 Thread markt
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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 5fd6d601a9 Code clean-up. Formatting. No functional change.
5fd6d601a9 is described below

commit 5fd6d601a9e73c4fa01d6cfd8316f30a3d6ba331
Author: Mark Thomas 
AuthorDate: Wed Mar 8 18:28:42 2023 +

Code clean-up. Formatting. No functional change.
---
 .../apache/tomcat/websocket/server/Constants.java  |   9 +-
 .../server/DefaultServerEndpointConfigurator.java  |  17 +--
 .../tomcat/websocket/server/UpgradeUtil.java   | 130 +++--
 .../tomcat/websocket/server/UriTemplate.java   |  26 ++--
 .../tomcat/websocket/server/WsContextListener.java |  10 +-
 .../apache/tomcat/websocket/server/WsFilter.java   |  13 +-
 .../tomcat/websocket/server/WsFrameServer.java |  63 -
 .../websocket/server/WsHandshakeRequest.java   |  49 +++
 .../websocket/server/WsHttpUpgradeHandler.java |  58 +++-
 .../tomcat/websocket/server/WsMappingResult.java   |   7 +-
 .../server/WsPerSessionServerEndpointConfig.java   |  12 +-
 .../server/WsRemoteEndpointImplServer.java |  33 ++---
 java/org/apache/tomcat/websocket/server/WsSci.java |  36 ++---
 .../tomcat/websocket/server/WsServerContainer.java | 156 -
 .../tomcat/websocket/server/WsSessionListener.java |   2 +-
 .../tomcat/websocket/server/WsWriteTimeout.java|  18 +--
 .../tomcat/websocket/server/package-info.java  |   4 +-
 17 files changed, 250 insertions(+), 393 deletions(-)

diff --git a/java/org/apache/tomcat/websocket/server/Constants.java 
b/java/org/apache/tomcat/websocket/server/Constants.java
index d30c880af0..5aa99bbb5e 100644
--- a/java/org/apache/tomcat/websocket/server/Constants.java
+++ b/java/org/apache/tomcat/websocket/server/Constants.java
@@ -21,13 +21,10 @@ package org.apache.tomcat.websocket.server;
  */
 public class Constants {
 
-public static final String BINARY_BUFFER_SIZE_SERVLET_CONTEXT_INIT_PARAM =
-"org.apache.tomcat.websocket.binaryBufferSize";
-public static final String TEXT_BUFFER_SIZE_SERVLET_CONTEXT_INIT_PARAM =
-"org.apache.tomcat.websocket.textBufferSize";
+public static final String BINARY_BUFFER_SIZE_SERVLET_CONTEXT_INIT_PARAM = 
"org.apache.tomcat.websocket.binaryBufferSize";
+public static final String TEXT_BUFFER_SIZE_SERVLET_CONTEXT_INIT_PARAM = 
"org.apache.tomcat.websocket.textBufferSize";
 
-public static final String SERVER_CONTAINER_SERVLET_CONTEXT_ATTRIBUTE =
-"jakarta.websocket.server.ServerContainer";
+public static final String SERVER_CONTAINER_SERVLET_CONTEXT_ATTRIBUTE = 
"jakarta.websocket.server.ServerContainer";
 
 
 private Constants() {
diff --git 
a/java/org/apache/tomcat/websocket/server/DefaultServerEndpointConfigurator.java
 
b/java/org/apache/tomcat/websocket/server/DefaultServerEndpointConfigurator.java
index 50252f61c1..24ed9e5c0f 100644
--- 
a/java/org/apache/tomcat/websocket/server/DefaultServerEndpointConfigurator.java
+++ 
b/java/org/apache/tomcat/websocket/server/DefaultServerEndpointConfigurator.java
@@ -26,13 +26,11 @@ import jakarta.websocket.HandshakeResponse;
 import jakarta.websocket.server.HandshakeRequest;
 import jakarta.websocket.server.ServerEndpointConfig;
 
-@aQute.bnd.annotation.spi.ServiceProvider(value=ServerEndpointConfig.Configurator.class)
-public class DefaultServerEndpointConfigurator
-extends ServerEndpointConfig.Configurator {
+@aQute.bnd.annotation.spi.ServiceProvider(value = 
ServerEndpointConfig.Configurator.class)
+public class DefaultServerEndpointConfigurator extends 
ServerEndpointConfig.Configurator {
 
 @Override
-public  T getEndpointInstance(Class clazz)
-throws InstantiationException {
+public  T getEndpointInstance(Class clazz) throws 
InstantiationException {
 try {
 return clazz.getConstructor().newInstance();
 } catch (InstantiationException e) {
@@ -46,8 +44,7 @@ public class DefaultServerEndpointConfigurator
 
 
 @Override
-public String getNegotiatedSubprotocol(List supported,
-List requested) {
+public String getNegotiatedSubprotocol(List supported, 
List requested) {
 
 for (String request : requested) {
 if (supported.contains(request)) {
@@ -59,8 +56,7 @@ public class DefaultServerEndpointConfigurator
 
 
 @Override
-public List getNegotiatedExtensions(List installed,
-List requested) {
+public List getNegotiatedExtensions(List installed, 
List requested) {
 Set installedNames = new HashSet<>();
 for (Extension e : installed) {
 installedNames.add(e.getName());
@@ -81,8 +77,7 @@ public class DefaultServerEndpointConfigurator
 }
 
 @Override
-public void modifyHandshake(ServerEndpointConfig sec,
-  

[tomcat] branch 10.1.x updated: Code clean-up. Formatting. No functional change.

2023-03-08 Thread markt
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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 74ffc1f399 Code clean-up. Formatting. No functional change.
74ffc1f399 is described below

commit 74ffc1f3990d44b374ea0ba740f193b38a961332
Author: Mark Thomas 
AuthorDate: Wed Mar 8 18:28:23 2023 +

Code clean-up. Formatting. No functional change.
---
 .../apache/tomcat/websocket/pojo/Constants.java|   3 +-
 .../tomcat/websocket/pojo/PojoEndpointBase.java|  49 ++--
 .../tomcat/websocket/pojo/PojoEndpointClient.java  |  10 +-
 .../tomcat/websocket/pojo/PojoEndpointServer.java  |  12 +-
 .../websocket/pojo/PojoMessageHandlerBase.java |  15 +-
 .../pojo/PojoMessageHandlerPartialBase.java|  22 +-
 .../pojo/PojoMessageHandlerPartialBinary.java  |  11 +-
 .../pojo/PojoMessageHandlerPartialText.java|  11 +-
 .../pojo/PojoMessageHandlerWholeBase.java  |  21 +-
 .../pojo/PojoMessageHandlerWholeBinary.java|  23 +-
 .../pojo/PojoMessageHandlerWholePong.java  |  11 +-
 .../pojo/PojoMessageHandlerWholeText.java  |  23 +-
 .../tomcat/websocket/pojo/PojoMethodMapping.java   | 318 -
 .../tomcat/websocket/pojo/PojoPathParam.java   |  12 +-
 .../apache/tomcat/websocket/pojo/package-info.java |   4 +-
 15 files changed, 216 insertions(+), 329 deletions(-)

diff --git a/java/org/apache/tomcat/websocket/pojo/Constants.java 
b/java/org/apache/tomcat/websocket/pojo/Constants.java
index 762ac9fe3f..1eba53131a 100644
--- a/java/org/apache/tomcat/websocket/pojo/Constants.java
+++ b/java/org/apache/tomcat/websocket/pojo/Constants.java
@@ -21,8 +21,7 @@ package org.apache.tomcat.websocket.pojo;
  */
 public class Constants {
 
-public static final String POJO_METHOD_MAPPING_KEY =
-"org.apache.tomcat.websocket.pojo.PojoEndpoint.methodMapping";
+public static final String POJO_METHOD_MAPPING_KEY = 
"org.apache.tomcat.websocket.pojo.PojoEndpoint.methodMapping";
 
 private Constants() {
 // Hide default constructor
diff --git a/java/org/apache/tomcat/websocket/pojo/PojoEndpointBase.java 
b/java/org/apache/tomcat/websocket/pojo/PojoEndpointBase.java
index 98e45cc0e1..8067b72325 100644
--- a/java/org/apache/tomcat/websocket/pojo/PojoEndpointBase.java
+++ b/java/org/apache/tomcat/websocket/pojo/PojoEndpointBase.java
@@ -33,9 +33,8 @@ import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.res.StringManager;
 
 /**
- * Base implementation (client and server have different concrete
- * implementations) of the wrapper that converts a POJO instance into a
- * WebSocket endpoint instance.
+ * Base implementation (client and server have different concrete 
implementations) of the wrapper that converts a POJO
+ * instance into a WebSocket endpoint instance.
  */
 public abstract class PojoEndpointBase extends Endpoint {
 
@@ -43,11 +42,11 @@ public abstract class PojoEndpointBase extends Endpoint {
 private static final StringManager sm = 
StringManager.getManager(PojoEndpointBase.class);
 
 private Object pojo;
-private final Map pathParameters;
+private final Map pathParameters;
 private PojoMethodMapping methodMapping;
 
 
-protected PojoEndpointBase(Map pathParameters) {
+protected PojoEndpointBase(Map pathParameters) {
 this.pathParameters = pathParameters;
 }
 
@@ -59,22 +58,17 @@ public abstract class PojoEndpointBase extends Endpoint {
 // Add message handlers before calling onOpen since that may trigger a
 // message which in turn could trigger a response and/or close the
 // session
-for (MessageHandler mh : methodMapping.getMessageHandlers(pojo,
-pathParameters, session, config)) {
+for (MessageHandler mh : methodMapping.getMessageHandlers(pojo, 
pathParameters, session, config)) {
 session.addMessageHandler(mh);
 }
 
 if (methodMapping.getOnOpen() != null) {
 try {
-methodMapping.getOnOpen().invoke(pojo,
-methodMapping.getOnOpenArgs(
-pathParameters, session, config));
+methodMapping.getOnOpen().invoke(pojo, 
methodMapping.getOnOpenArgs(pathParameters, session, config));
 
 } catch (IllegalAccessException e) {
 // Reflection related problems
-log.error(sm.getString(
-"pojoEndpointBase.onOpenFail",
-pojo.getClass().getName()), e);
+log.error(sm.getString("pojoEndpointBase.onOpenFail", 
pojo.getClass().getName()), e);
 handleOnOpenOrCloseError(session, e);
 } catch (InvocationTargetException e) {
 Throwable cause = e.getCause();
@@ -107,8 +101,7 @@ public abstract class PojoEnd