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

[tomcat] branch 10.1.x updated (23b4a05413 -> ba66bac46c)

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

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


    from 23b4a05413 Align with 11.0.x
     new ead86ce275 Clean-up (format) - no functional change
     new ba66bac46c Refactor to reduce code duplication

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/org/apache/catalina/mapper/Mapper.java        | 483 ++++++++-------------
 .../org/apache/catalina/mapper/MapperListener.java |  95 ++--
 .../apache/catalina/mapper/WrapperMappingInfo.java |   3 +-
 .../servlet/annotation/TestServletSecurity.java    |   6 +-
 .../annotation/TestServletSecurityMappings.java    |  94 ++--
 test/org/apache/catalina/mapper/TestMapper.java    | 142 ++----
 .../apache/catalina/mapper/TestMapperListener.java |  39 +-
 .../catalina/mapper/TestMapperPerformance.java     |  12 +-
 .../apache/catalina/mapper/TestMapperWebapps.java  |  69 ++-
 9 files changed, 341 insertions(+), 602 deletions(-)


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


[tomcat] 01/02: Clean-up (format) - no functional change

Posted by ma...@apache.org.
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 ead86ce27578e3e002cbcaa6908199ea14016aba
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Jan 27 13:52:32 2023 +0000

    Clean-up (format) - no functional change
---
 java/org/apache/catalina/mapper/Mapper.java        | 483 ++++++++-------------
 .../org/apache/catalina/mapper/MapperListener.java |  95 ++--
 .../apache/catalina/mapper/WrapperMappingInfo.java |   3 +-
 .../servlet/annotation/TestServletSecurity.java    |   6 +-
 .../annotation/TestServletSecurityMappings.java    |  55 +--
 test/org/apache/catalina/mapper/TestMapper.java    | 142 ++----
 .../apache/catalina/mapper/TestMapperListener.java |  39 +-
 .../catalina/mapper/TestMapperPerformance.java     |  12 +-
 .../apache/catalina/mapper/TestMapperWebapps.java  |  69 ++-
 9 files changed, 340 insertions(+), 564 deletions(-)

diff --git a/java/org/apache/catalina/mapper/Mapper.java b/java/org/apache/catalina/mapper/Mapper.java
index 62d4023eb8..c18554c8f6 100644
--- a/java/org/apache/catalina/mapper/Mapper.java
+++ b/java/org/apache/catalina/mapper/Mapper.java
@@ -40,8 +40,7 @@ import org.apache.tomcat.util.buf.MessageBytes;
 import org.apache.tomcat.util.res.StringManager;
 
 /**
- * Mapper, which implements the servlet API mapping rules (which are derived
- * from the HTTP rules).
+ * Mapper, which implements the servlet API mapping rules (which are derived from the HTTP rules).
  *
  * @author Remy Maucherat
  */
@@ -70,11 +69,9 @@ public final class Mapper {
 
 
     /**
-     * Mapping from Context object to Context version to support
-     * RequestDispatcher mappings.
+     * Mapping from Context object to Context version to support RequestDispatcher mappings.
      */
-    private final Map<Context, ContextVersion> contextObjectToContextVersionMap =
-            new ConcurrentHashMap<>();
+    private final Map<Context, ContextVersion> contextObjectToContextVersionMap = new ConcurrentHashMap<>();
 
 
     // --------------------------------------------------------- Public Methods
@@ -97,12 +94,11 @@ public final class Mapper {
     /**
      * Add a new host to the mapper.
      *
-     * @param name Virtual host name
+     * @param name    Virtual host name
      * @param aliases Alias names for the virtual host
-     * @param host Host object
+     * @param host    Host object
      */
-    public synchronized void addHost(String name, String[] aliases,
-                                     Host host) {
+    public synchronized void addHost(String name, String[] aliases, Host host) {
         name = renameWildcardHost(name);
         MappedHost[] newHosts = new MappedHost[hosts.length + 1];
         MappedHost newHost = new MappedHost(name, host);
@@ -124,8 +120,7 @@ public final class Mapper {
                 }
                 newHost = duplicate;
             } else {
-                log.error(sm.getString("mapper.duplicateHost", name,
-                        duplicate.getRealHostName()));
+                log.error(sm.getString("mapper.duplicateHost", name, duplicate.getRealHostName()));
                 // Do not add aliases, as removeHost(hostName) won't be able to
                 // remove them
                 return;
@@ -168,6 +163,7 @@ public final class Mapper {
 
     /**
      * Add an alias to an existing host.
+     *
      * @param name  The name of the host
      * @param alias The alias to add
      */
@@ -193,8 +189,7 @@ public final class Mapper {
                 defaultHost = newAlias;
             }
             if (log.isDebugEnabled()) {
-                log.debug(sm.getString("mapper.addHostAlias.success",
-                        newAlias.name, newAlias.getRealHostName()));
+                log.debug(sm.getString("mapper.addHostAlias.success", newAlias.name, newAlias.getRealHostName()));
             }
             return true;
         } else {
@@ -204,19 +199,19 @@ public final class Mapper {
                 // A harmless redundancy. E.g.
                 // <Host name="localhost"><Alias>localhost</Alias></Host>
                 if (log.isDebugEnabled()) {
-                    log.debug(sm.getString("mapper.addHostAlias.sameHost",
-                            newAlias.name, newAlias.getRealHostName()));
+                    log.debug(sm.getString("mapper.addHostAlias.sameHost", newAlias.name, newAlias.getRealHostName()));
                 }
                 return false;
             }
-            log.error(sm.getString("mapper.duplicateHostAlias", newAlias.name,
-                    newAlias.getRealHostName(), duplicate.getRealHostName()));
+            log.error(sm.getString("mapper.duplicateHostAlias", newAlias.name, newAlias.getRealHostName(),
+                    duplicate.getRealHostName()));
             return false;
         }
     }
 
     /**
      * Remove a host alias
+     *
      * @param alias The alias to remove
      */
     public synchronized void removeHostAlias(String alias) {
@@ -235,11 +230,9 @@ public final class Mapper {
     }
 
     /**
-     * Replace {@link MappedHost#contextList} field in <code>realHost</code> and
-     * all its aliases with a new value.
+     * Replace {@link MappedHost#contextList} field in <code>realHost</code> and all its aliases with a new value.
      */
-    private void updateContextList(MappedHost realHost,
-            ContextList newContextList) {
+    private void updateContextList(MappedHost realHost, ContextList newContextList) {
 
         realHost.contextList = newContextList;
         for (MappedHost alias : realHost.getAliases()) {
@@ -250,22 +243,21 @@ public final class Mapper {
     /**
      * Add a new Context to an existing Host.
      *
-     * @param hostName Virtual host name this context belongs to
-     * @param host Host object
-     * @param path Context path
-     * @param version Context version
-     * @param context Context object
+     * @param hostName         Virtual host name this context belongs to
+     * @param host             Host object
+     * @param path             Context path
+     * @param version          Context version
+     * @param context          Context object
      * @param welcomeResources Welcome files defined for this context
-     * @param resources Static resources of the context
-     * @param wrappers Information on wrapper mappings
+     * @param resources        Static resources of the context
+     * @param wrappers         Information on wrapper mappings
      */
-    public void addContextVersion(String hostName, Host host, String path,
-            String version, Context context, String[] welcomeResources,
-            WebResourceRoot resources, Collection<WrapperMappingInfo> wrappers) {
+    public void addContextVersion(String hostName, Host host, String path, String version, Context context,
+            String[] welcomeResources, WebResourceRoot resources, Collection<WrapperMappingInfo> wrappers) {
 
         hostName = renameWildcardHost(hostName);
 
-        MappedHost mappedHost  = exactFind(hosts, hostName);
+        MappedHost mappedHost = exactFind(hosts, hostName);
         if (mappedHost == null) {
             addHost(hostName, new String[0], host);
             mappedHost = exactFind(hosts, hostName);
@@ -280,8 +272,8 @@ public final class Mapper {
         }
         int slashCount = slashCount(path);
         synchronized (mappedHost) {
-            ContextVersion newContextVersion = new ContextVersion(version,
-                    path, slashCount, context, resources, welcomeResources);
+            ContextVersion newContextVersion = new ContextVersion(version, path, slashCount, context, resources,
+                    welcomeResources);
             if (wrappers != null) {
                 addWrappers(newContextVersion, wrappers);
             }
@@ -290,8 +282,7 @@ public final class Mapper {
             MappedContext mappedContext = exactFind(contextList.contexts, path);
             if (mappedContext == null) {
                 mappedContext = new MappedContext(path, newContextVersion);
-                ContextList newContextList = contextList.addContext(
-                        mappedContext, slashCount);
+                ContextList newContextList = contextList.addContext(mappedContext, slashCount);
                 if (newContextList != null) {
                     updateContextList(mappedHost, newContextList);
                     contextObjectToContextVersionMap.put(context, newContextVersion);
@@ -299,8 +290,7 @@ public final class Mapper {
             } else {
                 ContextVersion[] contextVersions = mappedContext.versions;
                 ContextVersion[] newContextVersions = new ContextVersion[contextVersions.length + 1];
-                if (insertMap(contextVersions, newContextVersions,
-                        newContextVersion)) {
+                if (insertMap(contextVersions, newContextVersions, newContextVersion)) {
                     mappedContext.versions = newContextVersions;
                     contextObjectToContextVersionMap.put(context, newContextVersion);
                 } else {
@@ -321,13 +311,12 @@ public final class Mapper {
     /**
      * Remove a context from an existing host.
      *
-     * @param ctxt      The actual context
-     * @param hostName  Virtual host name this context belongs to
-     * @param path      Context path
-     * @param version   Context version
+     * @param ctxt     The actual context
+     * @param hostName Virtual host name this context belongs to
+     * @param path     Context path
+     * @param version  Context version
      */
-    public void removeContextVersion(Context ctxt, String hostName,
-            String path, String version) {
+    public void removeContextVersion(Context ctxt, String hostName, String path, String version) {
 
         hostName = renameWildcardHost(hostName);
         contextObjectToContextVersionMap.remove(ctxt);
@@ -345,8 +334,7 @@ public final class Mapper {
             }
 
             ContextVersion[] contextVersions = context.versions;
-            ContextVersion[] newContextVersions =
-                new ContextVersion[contextVersions.length - 1];
+            ContextVersion[] newContextVersions = new ContextVersion[contextVersions.length - 1];
             if (removeMap(contextVersions, newContextVersions, version)) {
                 if (newContextVersions.length == 0) {
                     // Remove the context
@@ -363,19 +351,17 @@ public final class Mapper {
 
 
     /**
-     * Mark a context as being reloaded. Reversion of this state is performed
-     * by calling <code>addContextVersion(...)</code> when context starts up.
+     * Mark a context as being reloaded. Reversion of this state is performed by calling
+     * <code>addContextVersion(...)</code> when context starts up.
      *
-     * @param ctxt      The actual context
-     * @param hostName  Virtual host name this context belongs to
+     * @param ctxt        The actual context
+     * @param hostName    Virtual host name this context belongs to
      * @param contextPath Context path
-     * @param version   Context version
+     * @param version     Context version
      */
-    public void pauseContextVersion(Context ctxt, String hostName,
-            String contextPath, String version) {
+    public void pauseContextVersion(Context ctxt, String hostName, String contextPath, String version) {
         hostName = renameWildcardHost(hostName);
-        ContextVersion contextVersion = findContextVersion(hostName,
-                contextPath, version, true);
+        ContextVersion contextVersion = findContextVersion(hostName, contextPath, version, true);
         if (contextVersion == null || !ctxt.equals(contextVersion.object)) {
             return;
         }
@@ -383,8 +369,7 @@ public final class Mapper {
     }
 
 
-    private ContextVersion findContextVersion(String hostName,
-            String contextPath, String version, boolean silent) {
+    private ContextVersion findContextVersion(String hostName, String contextPath, String version, boolean silent) {
         MappedHost host = exactFind(hosts, hostName);
         if (host == null || host.isAlias()) {
             if (!silent) {
@@ -392,8 +377,7 @@ public final class Mapper {
             }
             return null;
         }
-        MappedContext context = exactFind(host.contextList.contexts,
-                contextPath);
+        MappedContext context = exactFind(host.contextList.contexts, contextPath);
         if (context == null) {
             if (!silent) {
                 log.error(sm.getString("mapper.findContext.noContext", contextPath));
@@ -411,23 +395,20 @@ public final class Mapper {
     }
 
 
-    public void addWrapper(String hostName, String contextPath, String version,
-                           String path, Wrapper wrapper, boolean jspWildCard,
-                           boolean resourceOnly) {
+    public void addWrapper(String hostName, String contextPath, String version, String path, Wrapper wrapper,
+            boolean jspWildCard, boolean resourceOnly) {
         hostName = renameWildcardHost(hostName);
-        ContextVersion contextVersion = findContextVersion(hostName,
-                contextPath, version, false);
+        ContextVersion contextVersion = findContextVersion(hostName, contextPath, version, false);
         if (contextVersion == null) {
             return;
         }
         addWrapper(contextVersion, path, wrapper, jspWildCard, resourceOnly);
     }
 
-    public void addWrappers(String hostName, String contextPath,
-            String version, Collection<WrapperMappingInfo> wrappers) {
+    public void addWrappers(String hostName, String contextPath, String version,
+            Collection<WrapperMappingInfo> wrappers) {
         hostName = renameWildcardHost(hostName);
-        ContextVersion contextVersion = findContextVersion(hostName,
-                contextPath, version, false);
+        ContextVersion contextVersion = findContextVersion(hostName, contextPath, version, false);
         if (contextVersion == null) {
             return;
         }
@@ -438,13 +419,11 @@ public final class Mapper {
      * Adds wrappers to the given context.
      *
      * @param contextVersion The context to which to add the wrappers
-     * @param wrappers Information on wrapper mappings
+     * @param wrappers       Information on wrapper mappings
      */
-    private void addWrappers(ContextVersion contextVersion,
-            Collection<WrapperMappingInfo> wrappers) {
+    private void addWrappers(ContextVersion contextVersion, Collection<WrapperMappingInfo> wrappers) {
         for (WrapperMappingInfo wrapper : wrappers) {
-            addWrapper(contextVersion, wrapper.getMapping(),
-                    wrapper.getWrapper(), wrapper.isJspWildCard(),
+            addWrapper(contextVersion, wrapper.getMapping(), wrapper.getWrapper(), wrapper.isJspWildCard(),
                     wrapper.isResourceOnly());
         }
     }
@@ -452,23 +431,21 @@ public final class Mapper {
     /**
      * Adds a wrapper to the given context.
      *
-     * @param context The context to which to add the wrapper
-     * @param path Wrapper mapping
-     * @param wrapper The Wrapper object
-     * @param jspWildCard true if the wrapper corresponds to the JspServlet
-     *   and the mapping path contains a wildcard; false otherwise
-     * @param resourceOnly true if this wrapper always expects a physical
-     *                     resource to be present (such as a JSP)
+     * @param context      The context to which to add the wrapper
+     * @param path         Wrapper mapping
+     * @param wrapper      The Wrapper object
+     * @param jspWildCard  true if the wrapper corresponds to the JspServlet and the mapping path contains a wildcard;
+     *                         false otherwise
+     * @param resourceOnly true if this wrapper always expects a physical resource to be present (such as a JSP)
      */
-    protected void addWrapper(ContextVersion context, String path,
-            Wrapper wrapper, boolean jspWildCard, boolean resourceOnly) {
+    protected void addWrapper(ContextVersion context, String path, Wrapper wrapper, boolean jspWildCard,
+            boolean resourceOnly) {
 
         synchronized (context) {
             if (path.endsWith("/*")) {
                 // Wildcard wrapper
                 String name = path.substring(0, path.length() - 2);
-                MappedWrapper newWrapper = new MappedWrapper(name, wrapper,
-                        jspWildCard, resourceOnly);
+                MappedWrapper newWrapper = new MappedWrapper(name, wrapper, jspWildCard, resourceOnly);
                 MappedWrapper[] oldWrappers = context.wildcardWrappers;
                 MappedWrapper[] newWrappers = new MappedWrapper[oldWrappers.length + 1];
                 if (insertMap(oldWrappers, newWrappers, newWrapper)) {
@@ -481,18 +458,15 @@ public final class Mapper {
             } else if (path.startsWith("*.")) {
                 // Extension wrapper
                 String name = path.substring(2);
-                MappedWrapper newWrapper = new MappedWrapper(name, wrapper,
-                        jspWildCard, resourceOnly);
+                MappedWrapper newWrapper = new MappedWrapper(name, wrapper, jspWildCard, resourceOnly);
                 MappedWrapper[] oldWrappers = context.extensionWrappers;
-                MappedWrapper[] newWrappers =
-                    new MappedWrapper[oldWrappers.length + 1];
+                MappedWrapper[] newWrappers = new MappedWrapper[oldWrappers.length + 1];
                 if (insertMap(oldWrappers, newWrappers, newWrapper)) {
                     context.extensionWrappers = newWrappers;
                 }
             } else if (path.equals("/")) {
                 // Default wrapper
-                MappedWrapper newWrapper = new MappedWrapper("", wrapper,
-                        jspWildCard, resourceOnly);
+                MappedWrapper newWrapper = new MappedWrapper("", wrapper, jspWildCard, resourceOnly);
                 context.defaultWrapper = newWrapper;
             } else {
                 // Exact wrapper
@@ -504,8 +478,7 @@ public final class Mapper {
                 } else {
                     name = path;
                 }
-                MappedWrapper newWrapper = new MappedWrapper(name, wrapper,
-                        jspWildCard, resourceOnly);
+                MappedWrapper newWrapper = new MappedWrapper(name, wrapper, jspWildCard, resourceOnly);
                 MappedWrapper[] oldWrappers = context.exactWrappers;
                 MappedWrapper[] newWrappers = new MappedWrapper[oldWrappers.length + 1];
                 if (insertMap(oldWrappers, newWrappers, newWrapper)) {
@@ -524,11 +497,9 @@ public final class Mapper {
      * @param version     Context version this wrapper belongs to
      * @param path        Wrapper mapping
      */
-    public void removeWrapper(String hostName, String contextPath,
-            String version, String path) {
+    public void removeWrapper(String hostName, String contextPath, String version, String path) {
         hostName = renameWildcardHost(hostName);
-        ContextVersion contextVersion = findContextVersion(hostName,
-                contextPath, version, true);
+        ContextVersion contextVersion = findContextVersion(hostName, contextPath, version, true);
         if (contextVersion == null || contextVersion.isPaused()) {
             return;
         }
@@ -549,8 +520,7 @@ public final class Mapper {
                 if (oldWrappers.length == 0) {
                     return;
                 }
-                MappedWrapper[] newWrappers =
-                    new MappedWrapper[oldWrappers.length - 1];
+                MappedWrapper[] newWrappers = new MappedWrapper[oldWrappers.length - 1];
                 if (removeMap(oldWrappers, newWrappers, name)) {
                     // Recalculate nesting
                     context.nesting = 0;
@@ -569,8 +539,7 @@ public final class Mapper {
                 if (oldWrappers.length == 0) {
                     return;
                 }
-                MappedWrapper[] newWrappers =
-                    new MappedWrapper[oldWrappers.length - 1];
+                MappedWrapper[] newWrappers = new MappedWrapper[oldWrappers.length - 1];
                 if (removeMap(oldWrappers, newWrappers, name)) {
                     context.extensionWrappers = newWrappers;
                 }
@@ -591,8 +560,7 @@ public final class Mapper {
                 if (oldWrappers.length == 0) {
                     return;
                 }
-                MappedWrapper[] newWrappers =
-                    new MappedWrapper[oldWrappers.length - 1];
+                MappedWrapper[] newWrappers = new MappedWrapper[oldWrappers.length - 1];
                 if (removeMap(oldWrappers, newWrappers, name)) {
                     context.exactWrappers = newWrappers;
                 }
@@ -609,8 +577,7 @@ public final class Mapper {
      * @param version     The version of the given context
      * @param welcomeFile The welcome file to add
      */
-    public void addWelcomeFile(String hostName, String contextPath, String version,
-            String welcomeFile) {
+    public void addWelcomeFile(String hostName, String contextPath, String version, String welcomeFile) {
         hostName = renameWildcardHost(hostName);
         ContextVersion contextVersion = findContextVersion(hostName, contextPath, version, false);
         if (contextVersion == null) {
@@ -632,8 +599,7 @@ public final class Mapper {
      * @param version     The version of the given context
      * @param welcomeFile The welcome file to remove
      */
-    public void removeWelcomeFile(String hostName, String contextPath,
-            String version, String welcomeFile) {
+    public void removeWelcomeFile(String hostName, String contextPath, String version, String welcomeFile) {
         hostName = renameWildcardHost(hostName);
         ContextVersion contextVersion = findContextVersion(hostName, contextPath, version, false);
         if (contextVersion == null || contextVersion.isPaused()) {
@@ -651,8 +617,7 @@ public final class Mapper {
             String[] newWelcomeResources = new String[len];
             System.arraycopy(contextVersion.welcomeResources, 0, newWelcomeResources, 0, match);
             if (match < len) {
-                System.arraycopy(contextVersion.welcomeResources, match + 1,
-                        newWelcomeResources, match, len - match);
+                System.arraycopy(contextVersion.welcomeResources, match + 1, newWelcomeResources, match, len - match);
             }
             contextVersion.welcomeResources = newWelcomeResources;
         }
@@ -679,16 +644,14 @@ public final class Mapper {
     /**
      * Map the specified host name and URI, mutating the given mapping data.
      *
-     * @param host Virtual host name
-     * @param uri URI
-     * @param version The version, if any, included in the request to be mapped
-     * @param mappingData This structure will contain the result of the mapping
-     *                    operation
-     * @throws IOException if the buffers are too small to hold the results of
-     *                     the mapping.
+     * @param host        Virtual host name
+     * @param uri         URI
+     * @param version     The version, if any, included in the request to be mapped
+     * @param mappingData This structure will contain the result of the mapping operation
+     *
+     * @throws IOException if the buffers are too small to hold the results of the mapping.
      */
-    public void map(MessageBytes host, MessageBytes uri, String version,
-                    MappingData mappingData) throws IOException {
+    public void map(MessageBytes host, MessageBytes uri, String version, MappingData mappingData) throws IOException {
 
         if (host.isNull()) {
             String defaultHostName = this.defaultHostName;
@@ -705,21 +668,17 @@ public final class Mapper {
 
 
     /**
-     * Map the specified URI relative to the context,
-     * mutating the given mapping data.
+     * Map the specified URI relative to the context, mutating the given mapping data.
      *
-     * @param context The actual context
-     * @param uri URI
-     * @param mappingData This structure will contain the result of the mapping
-     *                    operation
-     * @throws IOException if the buffers are too small to hold the results of
-     *                     the mapping.
+     * @param context     The actual context
+     * @param uri         URI
+     * @param mappingData This structure will contain the result of the mapping operation
+     *
+     * @throws IOException if the buffers are too small to hold the results of the mapping.
      */
-    public void map(Context context, MessageBytes uri,
-            MappingData mappingData) throws IOException {
+    public void map(Context context, MessageBytes uri, MappingData mappingData) throws IOException {
 
-        ContextVersion contextVersion =
-                contextObjectToContextVersionMap.get(context);
+        ContextVersion contextVersion = contextObjectToContextVersionMap.get(context);
         uri.toChars();
         CharChunk uricc = uri.getCharChunk();
         uricc.setLimit(-1);
@@ -731,11 +690,11 @@ public final class Mapper {
 
     /**
      * Map the specified URI.
-     * @throws IOException If an error occurs while manipulating the URI during
-     *         the mapping
+     *
+     * @throws IOException If an error occurs while manipulating the URI during the mapping
      */
-    private final void internalMap(CharChunk host, CharChunk uri,
-            String version, MappingData mappingData) throws IOException {
+    private final void internalMap(CharChunk host, CharChunk uri, String version, MappingData mappingData)
+            throws IOException {
 
         if (mappingData.host != null) {
             // The legacy code (dating down at least to Tomcat 4.1) just
@@ -750,7 +709,7 @@ public final class Mapper {
         MappedHost mappedHost = exactFindIgnoreCase(hosts, host);
         if (mappedHost == null) {
             // Note: Internally, the Mapper does not use the leading * on a
-            //       wildcard host. This is to allow this shortcut.
+            // wildcard host. This is to allow this shortcut.
             int firstDot = host.indexOf('.');
             if (firstDot > -1) {
                 int offset = host.getOffset();
@@ -855,12 +814,11 @@ public final class Mapper {
 
     /**
      * Wrapper mapping.
-     * @throws IOException if the buffers are too small to hold the results of
-     *                     the mapping.
+     *
+     * @throws IOException if the buffers are too small to hold the results of the mapping.
      */
-    private final void internalMapWrapper(ContextVersion contextVersion,
-                                          CharChunk path,
-                                          MappingData mappingData) throws IOException {
+    private final void internalMapWrapper(ContextVersion contextVersion, CharChunk path, MappingData mappingData)
+            throws IOException {
 
         int pathOffset = path.getOffset();
         int pathEnd = path.getEnd();
@@ -881,37 +839,31 @@ public final class Mapper {
         boolean checkJspWelcomeFiles = false;
         MappedWrapper[] wildcardWrappers = contextVersion.wildcardWrappers;
         if (mappingData.wrapper == null) {
-            internalMapWildcardWrapper(wildcardWrappers, contextVersion.nesting,
-                                       path, mappingData);
+            internalMapWildcardWrapper(wildcardWrappers, contextVersion.nesting, path, mappingData);
             if (mappingData.wrapper != null && mappingData.jspWildCard) {
                 char[] buf = path.getBuffer();
                 if (buf[pathEnd - 1] == '/') {
                     /*
-                     * Path ending in '/' was mapped to JSP servlet based on
-                     * wildcard match (e.g., as specified in url-pattern of a
-                     * jsp-property-group.
-                     * Force the context's welcome files, which are interpreted
-                     * as JSP files (since they match the url-pattern), to be
-                     * considered. See Bugzilla 27664.
+                     * Path ending in '/' was mapped to JSP servlet based on wildcard match (e.g., as specified in
+                     * url-pattern of a jsp-property-group. Force the context's welcome files, which are interpreted as
+                     * JSP files (since they match the url-pattern), to be considered. See Bugzilla 27664.
                      */
                     mappingData.wrapper = null;
                     checkJspWelcomeFiles = true;
                 } else {
                     // See Bugzilla 27704
-                    mappingData.wrapperPath.setChars(buf, path.getStart(),
-                                                     path.getLength());
+                    mappingData.wrapperPath.setChars(buf, path.getStart(), path.getLength());
                     mappingData.pathInfo.recycle();
                 }
             }
         }
 
-        if(mappingData.wrapper == null && noServletPath &&
+        if (mappingData.wrapper == null && noServletPath &&
                 contextVersion.object.getMapperContextRootRedirectEnabled()) {
             // The path is empty, redirect to "/"
             path.append('/');
             pathEnd = path.getEnd();
-            mappingData.redirectPath.setChars
-                (path.getBuffer(), pathOffset, pathEnd - pathOffset);
+            mappingData.redirectPath.setChars(path.getBuffer(), pathOffset, pathEnd - pathOffset);
             path.setEnd(pathEnd - 1);
             return;
         }
@@ -919,8 +871,7 @@ public final class Mapper {
         // Rule 3 -- Extension Match
         MappedWrapper[] extensionWrappers = contextVersion.extensionWrappers;
         if (mappingData.wrapper == null && !checkJspWelcomeFiles) {
-            internalMapExtensionWrapper(extensionWrappers, path, mappingData,
-                    true);
+            internalMapExtensionWrapper(extensionWrappers, path, mappingData, true);
         }
 
         // Rule 4 -- Welcome resources processing for servlets
@@ -931,12 +882,10 @@ public final class Mapper {
                 checkWelcomeFiles = (buf[pathEnd - 1] == '/');
             }
             if (checkWelcomeFiles) {
-                for (int i = 0; (i < contextVersion.welcomeResources.length)
-                         && (mappingData.wrapper == null); i++) {
+                for (int i = 0; (i < contextVersion.welcomeResources.length) && (mappingData.wrapper == null); i++) {
                     path.setOffset(pathOffset);
                     path.setEnd(pathEnd);
-                    path.append(contextVersion.welcomeResources[i], 0,
-                            contextVersion.welcomeResources[i].length());
+                    path.append(contextVersion.welcomeResources[i], 0, contextVersion.welcomeResources[i].length());
                     path.setOffset(servletPath);
 
                     // Rule 4a -- Welcome resources processing for exact macth
@@ -944,31 +893,20 @@ public final class Mapper {
 
                     // Rule 4b -- Welcome resources processing for prefix match
                     if (mappingData.wrapper == null) {
-                        internalMapWildcardWrapper
-                            (wildcardWrappers, contextVersion.nesting,
-                             path, mappingData);
+                        internalMapWildcardWrapper(wildcardWrappers, contextVersion.nesting, path, mappingData);
                     }
 
                     // Rule 4c -- Welcome resources processing
-                    //            for physical folder
-                    if (mappingData.wrapper == null
-                        && contextVersion.resources != null) {
+                    // for physical folder
+                    if (mappingData.wrapper == null && contextVersion.resources != null) {
                         String pathStr = path.toString();
-                        WebResource file =
-                                contextVersion.resources.getResource(pathStr);
+                        WebResource file = contextVersion.resources.getResource(pathStr);
                         if (file != null && file.isFile()) {
-                            internalMapExtensionWrapper(extensionWrappers, path,
-                                                        mappingData, true);
-                            if (mappingData.wrapper == null
-                                && contextVersion.defaultWrapper != null) {
-                                mappingData.wrapper =
-                                    contextVersion.defaultWrapper.object;
-                                mappingData.requestPath.setChars
-                                    (path.getBuffer(), path.getStart(),
-                                     path.getLength());
-                                mappingData.wrapperPath.setChars
-                                    (path.getBuffer(), path.getStart(),
-                                     path.getLength());
+                            internalMapExtensionWrapper(extensionWrappers, path, mappingData, true);
+                            if (mappingData.wrapper == null && contextVersion.defaultWrapper != null) {
+                                mappingData.wrapper = contextVersion.defaultWrapper.object;
+                                mappingData.requestPath.setChars(path.getBuffer(), path.getStart(), path.getLength());
+                                mappingData.wrapperPath.setChars(path.getBuffer(), path.getStart(), path.getLength());
                                 mappingData.requestPath.setString(pathStr);
                                 mappingData.wrapperPath.setString(pathStr);
                             }
@@ -982,12 +920,10 @@ public final class Mapper {
 
         }
 
-        /* welcome file processing - take 2
-         * Now that we have looked for welcome files with a physical
-         * backing, now look for an extension mapping listed
-         * but may not have a physical backing to it. This is for
-         * the case of index.jsf, index.do, etc.
-         * A watered down version of rule 4
+        /*
+         * welcome file processing - take 2 Now that we have looked for welcome files with a physical backing, now look
+         * for an extension mapping listed but may not have a physical backing to it. This is for the case of index.jsf,
+         * index.do, etc. A watered down version of rule 4
          */
         if (mappingData.wrapper == null) {
             boolean checkWelcomeFiles = checkJspWelcomeFiles;
@@ -996,15 +932,12 @@ public final class Mapper {
                 checkWelcomeFiles = (buf[pathEnd - 1] == '/');
             }
             if (checkWelcomeFiles) {
-                for (int i = 0; (i < contextVersion.welcomeResources.length)
-                         && (mappingData.wrapper == null); i++) {
+                for (int i = 0; (i < contextVersion.welcomeResources.length) && (mappingData.wrapper == null); i++) {
                     path.setOffset(pathOffset);
                     path.setEnd(pathEnd);
-                    path.append(contextVersion.welcomeResources[i], 0,
-                                contextVersion.welcomeResources[i].length());
+                    path.append(contextVersion.welcomeResources[i], 0, contextVersion.welcomeResources[i].length());
                     path.setOffset(servletPath);
-                    internalMapExtensionWrapper(extensionWrappers, path,
-                                                mappingData, false);
+                    internalMapExtensionWrapper(extensionWrappers, path, mappingData, false);
                 }
 
                 path.setOffset(servletPath);
@@ -1017,18 +950,16 @@ public final class Mapper {
         if (mappingData.wrapper == null && !checkJspWelcomeFiles) {
             if (contextVersion.defaultWrapper != null) {
                 mappingData.wrapper = contextVersion.defaultWrapper.object;
-                mappingData.requestPath.setChars
-                    (path.getBuffer(), path.getStart(), path.getLength());
-                mappingData.wrapperPath.setChars
-                    (path.getBuffer(), path.getStart(), path.getLength());
+                mappingData.requestPath.setChars(path.getBuffer(), path.getStart(), path.getLength());
+                mappingData.wrapperPath.setChars(path.getBuffer(), path.getStart(), path.getLength());
                 mappingData.matchType = MappingMatch.DEFAULT;
             }
             // Redirection to a folder
             char[] buf = path.getBuffer();
-            if (contextVersion.resources != null && buf[pathEnd -1 ] != '/') {
+            if (contextVersion.resources != null && buf[pathEnd - 1] != '/') {
                 String pathStr = path.toString();
                 // Note: Check redirect first to save unnecessary getResource()
-                //       call. See BZ 62968.
+                // call. See BZ 62968.
                 if (contextVersion.object.getMapperDirectoryRedirectEnabled()) {
                     WebResource file;
                     // Handle context root
@@ -1043,8 +974,7 @@ public final class Mapper {
                         // shouldn't be any)
                         path.setOffset(pathOffset);
                         path.append('/');
-                        mappingData.redirectPath.setChars
-                            (path.getBuffer(), path.getStart(), path.getLength());
+                        mappingData.redirectPath.setChars(path.getBuffer(), path.getStart(), path.getLength());
                     } else {
                         mappingData.requestPath.setString(pathStr);
                         mappingData.wrapperPath.setString(pathStr);
@@ -1064,8 +994,7 @@ public final class Mapper {
     /**
      * Exact mapping.
      */
-    private final void internalMapExactWrapper
-        (MappedWrapper[] wrappers, CharChunk path, MappingData mappingData) {
+    private final void internalMapExactWrapper(MappedWrapper[] wrappers, CharChunk path, MappingData mappingData) {
         MappedWrapper wrapper = exactFind(wrappers, path);
         if (wrapper != null) {
             mappingData.requestPath.setString(wrapper.name);
@@ -1086,9 +1015,8 @@ public final class Mapper {
     /**
      * Wildcard mapping.
      */
-    private final void internalMapWildcardWrapper
-        (MappedWrapper[] wrappers, int nesting, CharChunk path,
-         MappingData mappingData) {
+    private final void internalMapWildcardWrapper(MappedWrapper[] wrappers, int nesting, CharChunk path,
+            MappingData mappingData) {
 
         int pathEnd = path.getEnd();
 
@@ -1120,13 +1048,10 @@ public final class Mapper {
             if (found) {
                 mappingData.wrapperPath.setString(wrappers[pos].name);
                 if (path.getLength() > length) {
-                    mappingData.pathInfo.setChars
-                        (path.getBuffer(),
-                         path.getOffset() + length,
-                         path.getLength() - length);
+                    mappingData.pathInfo.setChars(path.getBuffer(), path.getOffset() + length,
+                            path.getLength() - length);
                 }
-                mappingData.requestPath.setChars
-                    (path.getBuffer(), path.getOffset(), path.getLength());
+                mappingData.requestPath.setChars(path.getBuffer(), path.getOffset(), path.getLength());
                 mappingData.wrapper = wrappers[pos].object;
                 mappingData.jspWildCard = wrappers[pos].jspWildCard;
                 mappingData.matchType = MappingMatch.PATH;
@@ -1138,13 +1063,13 @@ public final class Mapper {
     /**
      * Extension mappings.
      *
-     * @param wrappers          Set of wrappers to check for matches
-     * @param path              Path to map
-     * @param mappingData       Mapping data for result
-     * @param resourceExpected  Is this mapping expecting to find a resource
+     * @param wrappers         Set of wrappers to check for matches
+     * @param path             Path to map
+     * @param mappingData      Mapping data for result
+     * @param resourceExpected Is this mapping expecting to find a resource
      */
-    private final void internalMapExtensionWrapper(MappedWrapper[] wrappers,
-            CharChunk path, MappingData mappingData, boolean resourceExpected) {
+    private final void internalMapExtensionWrapper(MappedWrapper[] wrappers, CharChunk path, MappingData mappingData,
+            boolean resourceExpected) {
         char[] buf = path.getBuffer();
         int pathEnd = path.getEnd();
         int servletPath = path.getOffset();
@@ -1167,12 +1092,9 @@ public final class Mapper {
                 path.setOffset(period + 1);
                 path.setEnd(pathEnd);
                 MappedWrapper wrapper = exactFind(wrappers, path);
-                if (wrapper != null
-                        && (resourceExpected || !wrapper.resourceOnly)) {
-                    mappingData.wrapperPath.setChars(buf, servletPath, pathEnd
-                            - servletPath);
-                    mappingData.requestPath.setChars(buf, servletPath, pathEnd
-                            - servletPath);
+                if (wrapper != null && (resourceExpected || !wrapper.resourceOnly)) {
+                    mappingData.wrapperPath.setChars(buf, servletPath, pathEnd - servletPath);
+                    mappingData.requestPath.setChars(buf, servletPath, pathEnd - servletPath);
                     mappingData.wrapper = wrapper.object;
                     mappingData.matchType = MappingMatch.EXTENSION;
                 }
@@ -1184,9 +1106,8 @@ public final class Mapper {
 
 
     /**
-     * Find a map element given its name in a sorted array of map elements.
-     * This will return the index for the closest inferior or equal item in the
-     * given array.
+     * Find a map element given its name in a sorted array of map elements. This will return the index for the closest
+     * inferior or equal item in the given array.
      */
     private static final <T> int find(MapElement<T>[] map, CharChunk name) {
         return find(map, name, name.getStart(), name.getEnd());
@@ -1194,12 +1115,10 @@ public final class Mapper {
 
 
     /**
-     * Find a map element given its name in a sorted array of map elements.
-     * This will return the index for the closest inferior or equal item in the
-     * given array.
+     * Find a map element given its name in a sorted array of map elements. This will return the index for the closest
+     * inferior or equal item in the given array.
      */
-    private static final <T> int find(MapElement<T>[] map, CharChunk name,
-                                  int start, int end) {
+    private static final <T> int find(MapElement<T>[] map, CharChunk name, int start, int end) {
 
         int a = 0;
         int b = map.length - 1;
@@ -1209,7 +1128,7 @@ public final class Mapper {
             return -1;
         }
 
-        if (compare(name, start, end, map[0].name) < 0 ) {
+        if (compare(name, start, end, map[0].name) < 0) {
             return -1;
         }
         if (b == 0) {
@@ -1240,9 +1159,8 @@ public final class Mapper {
     }
 
     /**
-     * Find a map element given its name in a sorted array of map elements.
-     * This will return the index for the closest inferior or equal item in the
-     * given array.
+     * Find a map element given its name in a sorted array of map elements. This will return the index for the closest
+     * inferior or equal item in the given array.
      */
     private static final <T> int findIgnoreCase(MapElement<T>[] map, CharChunk name) {
         return findIgnoreCase(map, name, name.getStart(), name.getEnd());
@@ -1250,12 +1168,10 @@ public final class Mapper {
 
 
     /**
-     * Find a map element given its name in a sorted array of map elements.
-     * This will return the index for the closest inferior or equal item in the
-     * given array.
+     * Find a map element given its name in a sorted array of map elements. This will return the index for the closest
+     * inferior or equal item in the given array.
      */
-    private static final <T> int findIgnoreCase(MapElement<T>[] map, CharChunk name,
-                                  int start, int end) {
+    private static final <T> int findIgnoreCase(MapElement<T>[] map, CharChunk name, int start, int end) {
 
         int a = 0;
         int b = map.length - 1;
@@ -1264,7 +1180,7 @@ public final class Mapper {
         if (b == -1) {
             return -1;
         }
-        if (compareIgnoreCase(name, start, end, map[0].name) < 0 ) {
+        if (compareIgnoreCase(name, start, end, map[0].name) < 0) {
             return -1;
         }
         if (b == 0) {
@@ -1296,9 +1212,9 @@ public final class Mapper {
 
 
     /**
-     * Find a map element given its name in a sorted array of map elements.
-     * This will return the index for the closest inferior or equal item in the
-     * given array.
+     * Find a map element given its name in a sorted array of map elements. This will return the index for the closest
+     * inferior or equal item in the given array.
+     *
      * @see #exactFind(MapElement[], String)
      */
     private static final <T> int find(MapElement<T>[] map, String name) {
@@ -1343,13 +1259,12 @@ public final class Mapper {
 
 
     /**
-     * Find a map element given its name in a sorted array of map elements. This
-     * will return the element that you were searching for. Otherwise it will
-     * return <code>null</code>.
+     * Find a map element given its name in a sorted array of map elements. This will return the element that you were
+     * searching for. Otherwise it will return <code>null</code>.
+     *
      * @see #find(MapElement[], String)
      */
-    private static final <T, E extends MapElement<T>> E exactFind(E[] map,
-            String name) {
+    private static final <T, E extends MapElement<T>> E exactFind(E[] map, String name) {
         int pos = find(map, name);
         if (pos >= 0) {
             E result = map[pos];
@@ -1361,12 +1276,10 @@ public final class Mapper {
     }
 
     /**
-     * Find a map element given its name in a sorted array of map elements. This
-     * will return the element that you were searching for. Otherwise it will
-     * return <code>null</code>.
+     * Find a map element given its name in a sorted array of map elements. This will return the element that you were
+     * searching for. Otherwise it will return <code>null</code>.
      */
-    private static final <T, E extends MapElement<T>> E exactFind(E[] map,
-            CharChunk name) {
+    private static final <T, E extends MapElement<T>> E exactFind(E[] map, CharChunk name) {
         int pos = find(map, name);
         if (pos >= 0) {
             E result = map[pos];
@@ -1378,13 +1291,12 @@ public final class Mapper {
     }
 
     /**
-     * Find a map element given its name in a sorted array of map elements. This
-     * will return the element that you were searching for. Otherwise it will
-     * return <code>null</code>.
+     * Find a map element given its name in a sorted array of map elements. This will return the element that you were
+     * searching for. Otherwise it will return <code>null</code>.
+     *
      * @see #findIgnoreCase(MapElement[], CharChunk)
      */
-    private static final <T, E extends MapElement<T>> E exactFindIgnoreCase(
-            E[] map, CharChunk name) {
+    private static final <T, E extends MapElement<T>> E exactFindIgnoreCase(E[] map, CharChunk name) {
         int pos = findIgnoreCase(map, name);
         if (pos >= 0) {
             E result = map[pos];
@@ -1397,11 +1309,9 @@ public final class Mapper {
 
 
     /**
-     * Compare given char chunk with String.
-     * Return -1, 0 or +1 if inferior, equal, or superior to the String.
+     * Compare given char chunk with String. Return -1, 0 or +1 if inferior, equal, or superior to the String.
      */
-    private static final int compare(CharChunk name, int start, int end,
-                                     String compareTo) {
+    private static final int compare(CharChunk name, int start, int end, String compareTo) {
         int result = 0;
         char[] c = name.getBuffer();
         int len = compareTo.length();
@@ -1427,11 +1337,10 @@ public final class Mapper {
 
 
     /**
-     * Compare given char chunk with String ignoring case.
-     * Return -1, 0 or +1 if inferior, equal, or superior to the String.
+     * Compare given char chunk with String ignoring case. Return -1, 0 or +1 if inferior, equal, or superior to the
+     * String.
      */
-    private static final int compareIgnoreCase(CharChunk name, int start, int end,
-                                     String compareTo) {
+    private static final int compareIgnoreCase(CharChunk name, int start, int end, String compareTo) {
         int result = 0;
         char[] c = name.getBuffer();
         int len = compareTo.length();
@@ -1510,19 +1419,17 @@ public final class Mapper {
 
 
     /**
-     * Insert into the right place in a sorted MapElement array, and prevent
-     * duplicates.
+     * Insert into the right place in a sorted MapElement array, and prevent duplicates.
      */
-    private static final <T> boolean insertMap
-        (MapElement<T>[] oldMap, MapElement<T>[] newMap, MapElement<T> newElement) {
+    private static final <T> boolean insertMap(MapElement<T>[] oldMap, MapElement<T>[] newMap,
+            MapElement<T> newElement) {
         int pos = find(oldMap, newElement.name);
         if ((pos != -1) && (newElement.name.equals(oldMap[pos].name))) {
             return false;
         }
         System.arraycopy(oldMap, 0, newMap, 0, pos + 1);
         newMap[pos + 1] = newElement;
-        System.arraycopy
-            (oldMap, pos + 1, newMap, pos + 2, oldMap.length - pos - 1);
+        System.arraycopy(oldMap, pos + 1, newMap, pos + 2, oldMap.length - pos - 1);
         return true;
     }
 
@@ -1530,13 +1437,11 @@ public final class Mapper {
     /**
      * Insert into the right place in a sorted MapElement array.
      */
-    private static final <T> boolean removeMap
-        (MapElement<T>[] oldMap, MapElement<T>[] newMap, String name) {
+    private static final <T> boolean removeMap(MapElement<T>[] oldMap, MapElement<T>[] newMap, String name) {
         int pos = find(oldMap, name);
         if ((pos != -1) && (name.equals(oldMap[pos].name))) {
             System.arraycopy(oldMap, 0, newMap, 0, pos);
-            System.arraycopy(oldMap, pos + 1, newMap, pos,
-                             oldMap.length - pos - 1);
+            System.arraycopy(oldMap, pos + 1, newMap, pos, oldMap.length - pos - 1);
             return true;
         }
         return false;
@@ -1544,11 +1449,10 @@ public final class Mapper {
 
 
     /*
-     * To simplify the mapping process, wild card hosts take the form
-     * ".apache.org" rather than "*.apache.org" internally. However, for ease
-     * of use the external form remains "*.apache.org". Any host name passed
-     * into this class needs to be passed through this method to rename and
-     * wild card host names from the external to internal form.
+     * To simplify the mapping process, wild card hosts take the form ".apache.org" rather than "*.apache.org"
+     * internally. However, for ease of use the external form remains "*.apache.org". Any host name passed into this
+     * class needs to be passed through this method to rename and wild card host names from the external to internal
+     * form.
      */
     private static String renameWildcardHost(String hostName) {
         if (hostName != null && hostName.startsWith("*.")) {
@@ -1587,9 +1491,8 @@ public final class Mapper {
         private final MappedHost realHost;
 
         /**
-         * Links to all registered aliases, for easy enumeration. This field
-         * is available only in the "real" MappedHost. In an alias this field
-         * is <code>null</code>.
+         * Links to all registered aliases, for easy enumeration. This field is available only in the "real" MappedHost.
+         * In an alias this field is <code>null</code>.
          */
         private final List<MappedHost> aliases;
 
@@ -1666,12 +1569,10 @@ public final class Mapper {
             this.nesting = nesting;
         }
 
-        public ContextList addContext(MappedContext mappedContext,
-                int slashCount) {
+        public ContextList addContext(MappedContext mappedContext, int slashCount) {
             MappedContext[] newContexts = new MappedContext[contexts.length + 1];
             if (insertMap(contexts, newContexts, mappedContext)) {
-                return new ContextList(newContexts, Math.max(nesting,
-                        slashCount));
+                return new ContextList(newContexts, Math.max(nesting, slashCount));
             }
             return null;
         }
@@ -1714,8 +1615,7 @@ public final class Mapper {
         public int nesting = 0;
         private volatile boolean paused;
 
-        public ContextVersion(String version, String path, int slashCount,
-                Context context, WebResourceRoot resources,
+        public ContextVersion(String version, String path, int slashCount, Context context, WebResourceRoot resources,
                 String[] welcomeResources) {
             super(version, context);
             this.path = path;
@@ -1741,8 +1641,7 @@ public final class Mapper {
         public final boolean jspWildCard;
         public final boolean resourceOnly;
 
-        public MappedWrapper(String name, Wrapper wrapper, boolean jspWildCard,
-                boolean resourceOnly) {
+        public MappedWrapper(String name, Wrapper wrapper, boolean jspWildCard, boolean resourceOnly) {
             super(name, wrapper);
             this.jspWildCard = jspWildCard;
             this.resourceOnly = resourceOnly;
diff --git a/java/org/apache/catalina/mapper/MapperListener.java b/java/org/apache/catalina/mapper/MapperListener.java
index 67be0a7537..5ec8519d84 100644
--- a/java/org/apache/catalina/mapper/MapperListener.java
+++ b/java/org/apache/catalina/mapper/MapperListener.java
@@ -45,8 +45,7 @@ import org.apache.tomcat.util.res.StringManager;
  * @author Remy Maucherat
  * @author Costin Manolache
  */
-public class MapperListener extends LifecycleMBeanBase
-        implements ContainerListener, LifecycleListener {
+public class MapperListener extends LifecycleMBeanBase implements ContainerListener, LifecycleListener {
 
 
     private static final Log log = LogFactory.getLog(MapperListener.class);
@@ -67,8 +66,7 @@ public class MapperListener extends LifecycleMBeanBase
     /**
      * The string manager for this package.
      */
-    private static final StringManager sm =
-        StringManager.getManager(Constants.Package);
+    private static final StringManager sm = StringManager.getManager(Constants.Package);
 
     /**
      * The domain (effectively the engine) this mapper is associated with
@@ -174,8 +172,7 @@ public class MapperListener extends LifecycleMBeanBase
             // the child stops
         } else if (Host.ADD_ALIAS_EVENT.equals(event.getType())) {
             // Handle dynamically adding host aliases
-            mapper.addHostAlias(((Host) event.getSource()).getName(),
-                    event.getData().toString());
+            mapper.addHostAlias(((Host) event.getSource()).getName(), event.getData().toString());
         } else if (Host.REMOVE_ALIAS_EVENT.equals(event.getType())) {
             // Handle dynamically removing host aliases
             mapper.removeHostAlias(event.getData().toString());
@@ -191,10 +188,9 @@ public class MapperListener extends LifecycleMBeanBase
             String hostName = context.getParent().getName();
             String wrapperName = wrapper.getName();
             String mapping = (String) event.getData();
-            boolean jspWildCard = ("jsp".equals(wrapperName)
-                    && mapping.endsWith("/*"));
-            mapper.addWrapper(hostName, contextPath, version, mapping, wrapper,
-                    jspWildCard, context.isResourceOnlyServlet(wrapperName));
+            boolean jspWildCard = ("jsp".equals(wrapperName) && mapping.endsWith("/*"));
+            mapper.addWrapper(hostName, contextPath, version, mapping, wrapper, jspWildCard,
+                    context.isResourceOnlyServlet(wrapperName));
         } else if (Wrapper.REMOVE_MAPPING_EVENT.equals(event.getType())) {
             // Handle dynamically removing wrappers
             Wrapper wrapper = (Wrapper) event.getSource();
@@ -223,8 +219,7 @@ public class MapperListener extends LifecycleMBeanBase
 
             String welcomeFile = (String) event.getData();
 
-            mapper.addWelcomeFile(hostName, contextPath,
-                    context.getWebappVersion(), welcomeFile);
+            mapper.addWelcomeFile(hostName, contextPath, context.getWebappVersion(), welcomeFile);
         } else if (Context.REMOVE_WELCOME_FILE_EVENT.equals(event.getType())) {
             // Handle dynamically removing welcome files
             Context context = (Context) event.getSource();
@@ -238,8 +233,7 @@ public class MapperListener extends LifecycleMBeanBase
 
             String welcomeFile = (String) event.getData();
 
-            mapper.removeWelcomeFile(hostName, contextPath,
-                    context.getWebappVersion(), welcomeFile);
+            mapper.removeWelcomeFile(hostName, contextPath, context.getWebappVersion(), welcomeFile);
         } else if (Context.CLEAR_WELCOME_FILES_EVENT.equals(event.getType())) {
             // Handle dynamically clearing welcome files
             Context context = (Context) event.getSource();
@@ -251,8 +245,7 @@ public class MapperListener extends LifecycleMBeanBase
                 contextPath = "";
             }
 
-            mapper.clearWelcomeFiles(hostName, contextPath,
-                    context.getWebappVersion());
+            mapper.clearWelcomeFiles(hostName, contextPath, context.getWebappVersion());
         }
     }
 
@@ -311,9 +304,8 @@ public class MapperListener extends LifecycleMBeanBase
         // Default host may have changed
         findDefaultHost();
 
-        if(log.isDebugEnabled()) {
-            log.debug(sm.getString("mapperListener.registerHost",
-                    host.getName(), domain, service));
+        if (log.isDebugEnabled()) {
+            log.debug(sm.getString("mapperListener.registerHost", host.getName(), domain, service));
         }
     }
 
@@ -330,9 +322,8 @@ public class MapperListener extends LifecycleMBeanBase
         // Default host may have changed
         findDefaultHost();
 
-        if(log.isDebugEnabled()) {
-            log.debug(sm.getString("mapperListener.unregisterHost", hostname,
-                    domain, service));
+        if (log.isDebugEnabled()) {
+            log.debug(sm.getString("mapperListener.unregisterHost", hostname, domain, service));
         }
     }
 
@@ -355,12 +346,11 @@ public class MapperListener extends LifecycleMBeanBase
         String[] mappings = wrapper.findMappings();
 
         for (String mapping : mappings) {
-            mapper.removeWrapper(hostName, contextPath, version,  mapping);
+            mapper.removeWrapper(hostName, contextPath, version, mapping);
         }
 
-        if(log.isDebugEnabled()) {
-            log.debug(sm.getString("mapperListener.unregisterWrapper",
-                    wrapperName, contextPath, service));
+        if (log.isDebugEnabled()) {
+            log.debug(sm.getString("mapperListener.unregisterWrapper", wrapperName, contextPath, service));
         }
     }
 
@@ -374,7 +364,7 @@ public class MapperListener extends LifecycleMBeanBase
         if ("/".equals(contextPath)) {
             contextPath = "";
         }
-        Host host = (Host)context.getParent();
+        Host host = (Host) context.getParent();
 
         WebResourceRoot resources = context.getResources();
         String[] welcomeFiles = context.findWelcomeFiles();
@@ -383,19 +373,16 @@ public class MapperListener extends LifecycleMBeanBase
         for (Container container : context.findChildren()) {
             prepareWrapperMappingInfo(context, (Wrapper) container, wrappers);
 
-            if(log.isDebugEnabled()) {
-                log.debug(sm.getString("mapperListener.registerWrapper",
-                        container.getName(), contextPath, service));
+            if (log.isDebugEnabled()) {
+                log.debug(sm.getString("mapperListener.registerWrapper", container.getName(), contextPath, service));
             }
         }
 
-        mapper.addContextVersion(host.getName(), host, contextPath,
-                context.getWebappVersion(), context, welcomeFiles, resources,
-                wrappers);
+        mapper.addContextVersion(host.getName(), host, contextPath, context.getWebappVersion(), context, welcomeFiles,
+                resources, wrappers);
 
-        if(log.isDebugEnabled()) {
-            log.debug(sm.getString("mapperListener.registerContext",
-                    contextPath, service));
+        if (log.isDebugEnabled()) {
+            log.debug(sm.getString("mapperListener.registerContext", contextPath, service));
         }
     }
 
@@ -413,20 +400,16 @@ public class MapperListener extends LifecycleMBeanBase
 
         if (context.getPaused()) {
             if (log.isDebugEnabled()) {
-                log.debug(sm.getString("mapperListener.pauseContext",
-                        contextPath, service));
+                log.debug(sm.getString("mapperListener.pauseContext", contextPath, service));
             }
 
-            mapper.pauseContextVersion(context, hostName, contextPath,
-                    context.getWebappVersion());
+            mapper.pauseContextVersion(context, hostName, contextPath, context.getWebappVersion());
         } else {
             if (log.isDebugEnabled()) {
-                log.debug(sm.getString("mapperListener.unregisterContext",
-                        contextPath, service));
+                log.debug(sm.getString("mapperListener.unregisterContext", contextPath, service));
             }
 
-            mapper.removeContextVersion(context, hostName, contextPath,
-                    context.getWebappVersion());
+            mapper.removeContextVersion(context, hostName, contextPath, context.getWebappVersion());
         }
     }
 
@@ -448,26 +431,22 @@ public class MapperListener extends LifecycleMBeanBase
         prepareWrapperMappingInfo(context, wrapper, wrappers);
         mapper.addWrappers(hostName, contextPath, version, wrappers);
 
-        if(log.isDebugEnabled()) {
-            log.debug(sm.getString("mapperListener.registerWrapper",
-                    wrapper.getName(), contextPath, service));
+        if (log.isDebugEnabled()) {
+            log.debug(sm.getString("mapperListener.registerWrapper", wrapper.getName(), contextPath, service));
         }
     }
 
     /*
-     * Populate <code>wrappers</code> list with information for registration of
-     * mappings for this wrapper in this context.
+     * Populate <code>wrappers</code> list with information for registration of mappings for this wrapper in this
+     * context.
      */
-    private void prepareWrapperMappingInfo(Context context, Wrapper wrapper,
-            List<WrapperMappingInfo> wrappers) {
+    private void prepareWrapperMappingInfo(Context context, Wrapper wrapper, List<WrapperMappingInfo> wrappers) {
         String wrapperName = wrapper.getName();
         boolean resourceOnly = context.isResourceOnlyServlet(wrapperName);
         String[] mappings = wrapper.findMappings();
         for (String mapping : mappings) {
-            boolean jspWildCard = (wrapperName.equals("jsp")
-                                   && mapping.endsWith("/*"));
-            wrappers.add(new WrapperMappingInfo(mapping, wrapper, jspWildCard,
-                    resourceOnly));
+            boolean jspWildCard = (wrapperName.equals("jsp") && mapping.endsWith("/*"));
+            wrappers.add(new WrapperMappingInfo(mapping, wrapper, jspWildCard, resourceOnly));
         }
     }
 
@@ -508,8 +487,7 @@ public class MapperListener extends LifecycleMBeanBase
     /**
      * Add this mapper to the container and all child containers
      *
-     * @param container the container (and any associated children) to which
-     *        the mapper is to be added
+     * @param container the container (and any associated children) to which the mapper is to be added
      */
     private void addListeners(Container container) {
         container.addContainerListener(this);
@@ -523,8 +501,7 @@ public class MapperListener extends LifecycleMBeanBase
     /**
      * Remove this mapper from the container and all child containers
      *
-     * @param container the container (and any associated children) from which
-     *        the mapper is to be removed
+     * @param container the container (and any associated children) from which the mapper is to be removed
      */
     private void removeListeners(Container container) {
         container.removeContainerListener(this);
diff --git a/java/org/apache/catalina/mapper/WrapperMappingInfo.java b/java/org/apache/catalina/mapper/WrapperMappingInfo.java
index ef6b99d2be..1b2f0d4c11 100644
--- a/java/org/apache/catalina/mapper/WrapperMappingInfo.java
+++ b/java/org/apache/catalina/mapper/WrapperMappingInfo.java
@@ -28,8 +28,7 @@ public class WrapperMappingInfo {
     private final boolean jspWildCard;
     private final boolean resourceOnly;
 
-    public WrapperMappingInfo(String mapping, Wrapper wrapper,
-            boolean jspWildCard, boolean resourceOnly) {
+    public WrapperMappingInfo(String mapping, Wrapper wrapper, boolean jspWildCard, boolean resourceOnly) {
         this.mapping = mapping;
         this.wrapper = wrapper;
         this.jspWildCard = jspWildCard;
diff --git a/test/jakarta/servlet/annotation/TestServletSecurity.java b/test/jakarta/servlet/annotation/TestServletSecurity.java
index 45852667be..a195fb115e 100644
--- a/test/jakarta/servlet/annotation/TestServletSecurity.java
+++ b/test/jakarta/servlet/annotation/TestServletSecurity.java
@@ -88,8 +88,7 @@ public class TestServletSecurity extends TomcatBaseTest {
         private static final long serialVersionUID = 1L;
 
         @Override
-        protected void doGet(HttpServletRequest req, HttpServletResponse resp)
-                throws ServletException, IOException {
+        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
             resp.getWriter().print("OK: Foo");
         }
     }
@@ -100,8 +99,7 @@ public class TestServletSecurity extends TomcatBaseTest {
         private static final long serialVersionUID = 1L;
 
         @Override
-        protected void doGet(HttpServletRequest req, HttpServletResponse resp)
-                throws ServletException, IOException {
+        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
             resp.getWriter().print("OK: FooBar");
         }
     }
diff --git a/test/jakarta/servlet/annotation/TestServletSecurityMappings.java b/test/jakarta/servlet/annotation/TestServletSecurityMappings.java
index 3b16cb955c..3d4cfcf5c7 100644
--- a/test/jakarta/servlet/annotation/TestServletSecurityMappings.java
+++ b/test/jakarta/servlet/annotation/TestServletSecurityMappings.java
@@ -45,25 +45,25 @@ import org.apache.tomcat.util.buf.ByteChunk;
 @RunWith(Parameterized.class)
 public class TestServletSecurityMappings extends TomcatBaseTest {
 
-    @Parameters(name="{0}, {1}, {2}, {3}")
+    @Parameters(name = "{0}, {1}, {2}, {3}")
     public static Collection<Object[]> inputs() {
         List<Object[]> result = new ArrayList<>();
         result.add(new Object[] { Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, Boolean.FALSE });
         result.add(new Object[] { Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, Boolean.TRUE });
-        result.add(new Object[] { Boolean.FALSE, Boolean.FALSE, Boolean.TRUE , Boolean.FALSE });
-        result.add(new Object[] { Boolean.FALSE, Boolean.FALSE, Boolean.TRUE,  Boolean.TRUE });
-        result.add(new Object[] { Boolean.FALSE, Boolean.TRUE,  Boolean.FALSE, Boolean.FALSE });
-        result.add(new Object[] { Boolean.FALSE, Boolean.TRUE,  Boolean.FALSE, Boolean.TRUE });
-        result.add(new Object[] { Boolean.FALSE, Boolean.TRUE,  Boolean.TRUE , Boolean.FALSE });
-        result.add(new Object[] { Boolean.FALSE, Boolean.TRUE,  Boolean.TRUE,  Boolean.TRUE });
-        result.add(new Object[] { Boolean.TRUE,  Boolean.FALSE, Boolean.FALSE, Boolean.FALSE });
-        result.add(new Object[] { Boolean.TRUE,  Boolean.FALSE, Boolean.FALSE, Boolean.TRUE });
-        result.add(new Object[] { Boolean.TRUE,  Boolean.FALSE, Boolean.TRUE , Boolean.FALSE });
-        result.add(new Object[] { Boolean.TRUE,  Boolean.FALSE, Boolean.TRUE,  Boolean.TRUE });
-        result.add(new Object[] { Boolean.TRUE,  Boolean.TRUE,  Boolean.FALSE, Boolean.FALSE });
-        result.add(new Object[] { Boolean.TRUE,  Boolean.TRUE,  Boolean.FALSE, Boolean.TRUE });
-        result.add(new Object[] { Boolean.TRUE,  Boolean.TRUE,  Boolean.TRUE , Boolean.FALSE });
-        result.add(new Object[] { Boolean.TRUE,  Boolean.TRUE,  Boolean.TRUE,  Boolean.TRUE });
+        result.add(new Object[] { Boolean.FALSE, Boolean.FALSE, Boolean.TRUE, Boolean.FALSE });
+        result.add(new Object[] { Boolean.FALSE, Boolean.FALSE, Boolean.TRUE, Boolean.TRUE });
+        result.add(new Object[] { Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, Boolean.FALSE });
+        result.add(new Object[] { Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, Boolean.TRUE });
+        result.add(new Object[] { Boolean.FALSE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE });
+        result.add(new Object[] { Boolean.FALSE, Boolean.TRUE, Boolean.TRUE, Boolean.TRUE });
+        result.add(new Object[] { Boolean.TRUE, Boolean.FALSE, Boolean.FALSE, Boolean.FALSE });
+        result.add(new Object[] { Boolean.TRUE, Boolean.FALSE, Boolean.FALSE, Boolean.TRUE });
+        result.add(new Object[] { Boolean.TRUE, Boolean.FALSE, Boolean.TRUE, Boolean.FALSE });
+        result.add(new Object[] { Boolean.TRUE, Boolean.FALSE, Boolean.TRUE, Boolean.TRUE });
+        result.add(new Object[] { Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, Boolean.FALSE });
+        result.add(new Object[] { Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, Boolean.TRUE });
+        result.add(new Object[] { Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE });
+        result.add(new Object[] { Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, Boolean.TRUE });
         return result;
     }
 
@@ -119,7 +119,7 @@ public class TestServletSecurityMappings extends TomcatBaseTest {
         // Root
         rc = getUrl("http://localhost:" + getPort() + "/test", bc, false);
         if (redirectContextRoot) {
-           Assert.assertEquals(302, rc);
+            Assert.assertEquals(302, rc);
         } else {
             if (secureRoot || secureDefault) {
                 Assert.assertEquals(403, rc);
@@ -143,14 +143,13 @@ public class TestServletSecurityMappings extends TomcatBaseTest {
         }
 
         @Override
-        public void onStartup(Set<Class<?>> c, ServletContext ctx)
-                throws ServletException {
+        public void onStartup(Set<Class<?>> c, ServletContext ctx) throws ServletException {
 
             ServletRegistration.Dynamic sr;
             if (secureRoot) {
                 sr = ctx.addServlet("Root", SecureRoot.class.getName());
             } else {
-                sr =ctx.addServlet("Root", Root.class.getName());
+                sr = ctx.addServlet("Root", Root.class.getName());
             }
             sr.addMapping("");
 
@@ -177,8 +176,7 @@ public class TestServletSecurityMappings extends TomcatBaseTest {
         private static final long serialVersionUID = 1L;
 
         @Override
-        protected void doGet(HttpServletRequest req, HttpServletResponse resp)
-                throws ServletException, IOException {
+        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
             resp.getWriter().print("OK");
         }
     }
@@ -189,8 +187,7 @@ public class TestServletSecurityMappings extends TomcatBaseTest {
         private static final long serialVersionUID = 1L;
 
         @Override
-        protected void doGet(HttpServletRequest req, HttpServletResponse resp)
-                throws ServletException, IOException {
+        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
             resp.getWriter().print("OK");
         }
     }
@@ -202,8 +199,7 @@ public class TestServletSecurityMappings extends TomcatBaseTest {
         private static final long serialVersionUID = 1L;
 
         @Override
-        protected void doGet(HttpServletRequest req, HttpServletResponse resp)
-                throws ServletException, IOException {
+        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
             resp.getWriter().print("OK");
         }
     }
@@ -214,8 +210,7 @@ public class TestServletSecurityMappings extends TomcatBaseTest {
         private static final long serialVersionUID = 1L;
 
         @Override
-        protected void doGet(HttpServletRequest req, HttpServletResponse resp)
-                throws ServletException, IOException {
+        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
             resp.getWriter().print("OK");
         }
     }
@@ -227,8 +222,7 @@ public class TestServletSecurityMappings extends TomcatBaseTest {
         private static final long serialVersionUID = 1L;
 
         @Override
-        protected void doGet(HttpServletRequest req, HttpServletResponse resp)
-                throws ServletException, IOException {
+        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
             resp.getWriter().print("OK");
         }
     }
@@ -239,8 +233,7 @@ public class TestServletSecurityMappings extends TomcatBaseTest {
         private static final long serialVersionUID = 1L;
 
         @Override
-        protected void doGet(HttpServletRequest req, HttpServletResponse resp)
-                throws ServletException, IOException {
+        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
             resp.getWriter().print("OK");
         }
     }
diff --git a/test/org/apache/catalina/mapper/TestMapper.java b/test/org/apache/catalina/mapper/TestMapper.java
index 9ddeb02404..a84069b6b7 100644
--- a/test/org/apache/catalina/mapper/TestMapper.java
+++ b/test/org/apache/catalina/mapper/TestMapper.java
@@ -94,52 +94,32 @@ public class TestMapper extends LoggingBaseTest {
         welcomes[1] = "bobou";
 
         Host host = createHost("blah7");
-        mapper.addContextVersion("iowejoiejfoiew", host, "",
-                "0", createContext("context0"), new String[0], null, null);
-        mapper.addContextVersion("iowejoiejfoiew", host, "/foo",
-                "0", createContext("context1"), new String[0], null, null);
-        mapper.addContextVersion("iowejoiejfoiew", host, "/foo/bar",
-                "0", createContext("context2"), welcomes, null, null);
-
-        mapper.addWrappers("iowejoiejfoiew", "/foo", "0", Arrays
-                .asList(new WrapperMappingInfo[] {
-                        new WrapperMappingInfo("/",
-                                createWrapper("context1-defaultWrapper"), false, false) }));
-        mapper.addWrappers("iowejoiejfoiew", "/foo/bar", "0", Arrays
-                .asList(new WrapperMappingInfo[] {
-                        new WrapperMappingInfo("/fo/*",
-                                createWrapper("wrapper0"), false, false),
-                        new WrapperMappingInfo("/", createWrapper("wrapper1"),
-                                false, false),
-                        new WrapperMappingInfo("/blh",
-                                createWrapper("wrapper2"), false, false),
-                        new WrapperMappingInfo("*.jsp",
-                                createWrapper("wrapper3"), false, false),
-                        new WrapperMappingInfo("/blah/bou/*",
-                                createWrapper("wrapper4"), false, false),
-                        new WrapperMappingInfo("/blah/bobou/*",
-                                createWrapper("wrapper5"), false, false),
-                        new WrapperMappingInfo("*.htm",
-                                createWrapper("wrapper6"), false, false) }));
-
-        mapper.addContextVersion(
-                "iowejoiejfoiew",
-                host,
-                "/foo/bar/bla",
-                "0",
-                createContext("context3"),
-                new String[0],
-                null,
-                Arrays.asList(new WrapperMappingInfo[] { new WrapperMappingInfo(
-                        "/bobou/*", createWrapper("wrapper7"), false, false) }));
+        mapper.addContextVersion("iowejoiejfoiew", host, "", "0", createContext("context0"), new String[0], null, null);
+        mapper.addContextVersion("iowejoiejfoiew", host, "/foo", "0", createContext("context1"), new String[0], null,
+                null);
+        mapper.addContextVersion("iowejoiejfoiew", host, "/foo/bar", "0", createContext("context2"), welcomes, null,
+                null);
+
+        mapper.addWrappers("iowejoiejfoiew", "/foo", "0", Arrays.asList(new WrapperMappingInfo[] {
+                new WrapperMappingInfo("/", createWrapper("context1-defaultWrapper"), false, false) }));
+        mapper.addWrappers("iowejoiejfoiew", "/foo/bar", "0",
+                Arrays.asList(new WrapperMappingInfo[] {
+                        new WrapperMappingInfo("/fo/*", createWrapper("wrapper0"), false, false),
+                        new WrapperMappingInfo("/", createWrapper("wrapper1"), false, false),
+                        new WrapperMappingInfo("/blh", createWrapper("wrapper2"), false, false),
+                        new WrapperMappingInfo("*.jsp", createWrapper("wrapper3"), false, false),
+                        new WrapperMappingInfo("/blah/bou/*", createWrapper("wrapper4"), false, false),
+                        new WrapperMappingInfo("/blah/bobou/*", createWrapper("wrapper5"), false, false),
+                        new WrapperMappingInfo("*.htm", createWrapper("wrapper6"), false, false) }));
+
+        mapper.addContextVersion("iowejoiejfoiew", host, "/foo/bar/bla", "0", createContext("context3"), new String[0],
+                null, Arrays.asList(new WrapperMappingInfo[] {
+                        new WrapperMappingInfo("/bobou/*", createWrapper("wrapper7"), false, false) }));
 
         host = createHost("blah16");
-        mapper.addContextVersion("*.net", host, "", "0", createContext("context4"),
-                new String[0], null, null);
-        mapper.addWrappers("*.net", "", "0", Arrays
-                .asList(new WrapperMappingInfo[] {
-                        new WrapperMappingInfo("/",
-                                createWrapper("context4-defaultWrapper"), false, false) }));
+        mapper.addContextVersion("*.net", host, "", "0", createContext("context4"), new String[0], null, null);
+        mapper.addWrappers("*.net", "", "0", Arrays.asList(new WrapperMappingInfo[] {
+                new WrapperMappingInfo("/", createWrapper("context4-defaultWrapper"), false, false) }));
     }
 
     @Test
@@ -191,22 +171,18 @@ public class TestMapper extends LoggingBaseTest {
         Context contextZ = createContext("contextZ");
 
         Assert.assertEquals(19, mapper.hosts.length);
-        mapper.addContextVersion("zzzz", hostZ, "/", "", contextZ, null, null,
-                null);
+        mapper.addContextVersion("zzzz", hostZ, "/", "", contextZ, null, null, null);
         Assert.assertEquals(20, mapper.hosts.length);
 
-        mapper.addHost("zzzz", new String[] { "zzzz_alias1", "zzzz_alias2" },
-                hostZ);
+        mapper.addHost("zzzz", new String[] { "zzzz_alias1", "zzzz_alias2" }, hostZ);
         Assert.assertEquals(22, mapper.hosts.length);
 
         Assert.assertEquals("zzzz", mapper.hosts[19].name);
         Assert.assertEquals("zzzz_alias1", mapper.hosts[20].name);
         Assert.assertEquals("zzzz_alias2", mapper.hosts[21].name);
         Assert.assertEquals(2, mapper.hosts[19].getAliases().size());
-        Assert.assertSame(contextZ,
-                mapper.hosts[19].contextList.contexts[0].versions[0].object);
-        Assert.assertSame(contextZ,
-                mapper.hosts[21].contextList.contexts[0].versions[0].object);
+        Assert.assertSame(contextZ, mapper.hosts[19].contextList.contexts[0].versions[0].object);
+        Assert.assertSame(contextZ, mapper.hosts[21].contextList.contexts[0].versions[0].object);
     }
 
     @Test
@@ -338,16 +314,9 @@ public class TestMapper extends LoggingBaseTest {
         Assert.assertEquals("wrapper5", mappingData.wrapper.getName());
 
         Context newContext = createContext("newContext");
-        mapper.addContextVersion(
-                hostName,
-                oldHost,
-                contextPath,
-                "1",
-                newContext,
-                null,
-                null,
-                Arrays.asList(new WrapperMappingInfo[] { new WrapperMappingInfo(
-                        "/", createWrapper("newContext-default"), false, false) }));
+        mapper.addContextVersion(hostName, oldHost, contextPath, "1", newContext, null, null,
+                Arrays.asList(new WrapperMappingInfo[] {
+                        new WrapperMappingInfo("/", createWrapper("newContext-default"), false, false) }));
 
         Assert.assertEquals(2, mappedContext.versions.length);
         Assert.assertEquals("0", mappedContext.versions[0].name);
@@ -384,16 +353,9 @@ public class TestMapper extends LoggingBaseTest {
         mapper.map(oldContext1, uriMB, mappingData);
         Assert.assertEquals("context1-defaultWrapper", mappingData.wrapper.getName());
 
-        mapper.addContextVersion(
-                hostName,
-                oldHost,
-                contextPath,
-                "0",
-                newContext,
-                null,
-                null,
-                Arrays.asList(new WrapperMappingInfo[] { new WrapperMappingInfo(
-                        "/", createWrapper("newContext-defaultWrapper2"), false, false) }));
+        mapper.addContextVersion(hostName, oldHost, contextPath, "0", newContext, null, null,
+                Arrays.asList(new WrapperMappingInfo[] {
+                        new WrapperMappingInfo("/", createWrapper("newContext-defaultWrapper2"), false, false) }));
         mappedContext = mappedHost.contextList.contexts[contextPos];
 
         Assert.assertEquals(contextPath, mappedContext.name);
@@ -461,16 +423,9 @@ public class TestMapper extends LoggingBaseTest {
 
         // Re-add the same context, but different list of wrappers
         // This is what happens when context reload completes
-        mapper.addContextVersion(
-                hostName,
-                oldHost,
-                contextPath,
-                "0",
-                oldContext,
-                null,
-                null,
-                Arrays.asList(new WrapperMappingInfo[] { new WrapperMappingInfo(
-                        "/", createWrapper("newDefaultWrapper"), false, false) }));
+        mapper.addContextVersion(hostName, oldHost, contextPath, "0", oldContext, null, null,
+                Arrays.asList(new WrapperMappingInfo[] {
+                        new WrapperMappingInfo("/", createWrapper("newDefaultWrapper"), false, false) }));
 
         mappedContext = mappedHost.contextList.contexts[contextPos];
         Assert.assertEquals(contextPath, mappedContext.name);
@@ -499,27 +454,20 @@ public class TestMapper extends LoggingBaseTest {
         mapper.addHost("localhost", new String[] { "alias" }, host);
         mapper.setDefaultHostName("localhost");
 
-        mapper.addContextVersion("localhost", host, "", "0", contextRoot,
-                new String[0], null, null);
-        mapper.addContextVersion("localhost", host, "/foo", "0", context1,
-                new String[0], null, null);
-        mapper.addContextVersion("localhost", host, "/foo/bar", "0", context2,
-                new String[0], null, null);
-        mapper.addContextVersion("localhost", host, "/foo/bar/bla", "0",
-                context3, new String[0], null, null);
-        mapper.addContextVersion("localhost", host, "/foo/bar/bla/baz", "0",
-                context4, new String[0], null, null);
+        mapper.addContextVersion("localhost", host, "", "0", contextRoot, new String[0], null, null);
+        mapper.addContextVersion("localhost", host, "/foo", "0", context1, new String[0], null, null);
+        mapper.addContextVersion("localhost", host, "/foo/bar", "0", context2, new String[0], null, null);
+        mapper.addContextVersion("localhost", host, "/foo/bar/bla", "0", context3, new String[0], null, null);
+        mapper.addContextVersion("localhost", host, "/foo/bar/bla/baz", "0", context4, new String[0], null, null);
 
         final AtomicBoolean running = new AtomicBoolean(true);
         Thread t = new Thread() {
             @Override
             public void run() {
                 for (int i = 0; i < 100000; i++) {
-                    mapper.removeContextVersion(context4, "localhost",
-                            "/foo/bar/bla/baz", "0");
-                    mapper.addContextVersion("localhost", host,
-                            "/foo/bar/bla/baz", "0", context4, new String[0],
-                            null, null);
+                    mapper.removeContextVersion(context4, "localhost", "/foo/bar/bla/baz", "0");
+                    mapper.addContextVersion("localhost", host, "/foo/bar/bla/baz", "0", context4, new String[0], null,
+                            null);
                 }
                 running.set(false);
             }
diff --git a/test/org/apache/catalina/mapper/TestMapperListener.java b/test/org/apache/catalina/mapper/TestMapperListener.java
index 231d522ae4..a8a74073bd 100644
--- a/test/org/apache/catalina/mapper/TestMapperListener.java
+++ b/test/org/apache/catalina/mapper/TestMapperListener.java
@@ -38,8 +38,7 @@ import org.apache.tomcat.websocket.server.WsContextListener;
 public class TestMapperListener extends TomcatBaseTest {
 
     @Test
-    public void testTomcatRestartListenerCount_Bug56717() throws IOException,
-            LifecycleException {
+    public void testTomcatRestartListenerCount_Bug56717() throws IOException, LifecycleException {
         // The test runs Tomcat twice, tests that it has started successfully,
         // and compares the counts of listeners registered on containers
         // after the first and the second starts.
@@ -49,15 +48,13 @@ public class TestMapperListener extends TomcatBaseTest {
 
         File appDir = new File(getBuildDirectory(), "webapps/examples");
         // app dir is relative to server home
-        Context ctxt = tomcat.addWebapp(null, "/examples",
-                appDir.getAbsolutePath());
+        Context ctxt = tomcat.addWebapp(null, "/examples", appDir.getAbsolutePath());
         ctxt.addApplicationListener(WsContextListener.class.getName());
         tomcat.start();
 
         ByteChunk res;
         String text;
-        res = getUrl("http://localhost:" + getPort()
-                + "/examples/servlets/servlet/HelloWorldExample");
+        res = getUrl("http://localhost:" + getPort() + "/examples/servlets/servlet/HelloWorldExample");
         text = res.toString();
         Assert.assertTrue(text, text.contains("<a href=\"../helloworld.html\">"));
 
@@ -67,8 +64,7 @@ public class TestMapperListener extends TomcatBaseTest {
         tomcat.stop();
         tomcat.start();
 
-        res = getUrl("http://localhost:" + getPort()
-                + "/examples/servlets/servlet/HelloWorldExample");
+        res = getUrl("http://localhost:" + getPort() + "/examples/servlets/servlet/HelloWorldExample");
         text = res.toString();
         Assert.assertTrue(text, text.contains("<a href=\"../helloworld.html\">"));
 
@@ -79,9 +75,9 @@ public class TestMapperListener extends TomcatBaseTest {
         for (int i = 0, len = listenersFirst.size(); i < len; i++) {
             ListenersInfo a = listenersFirst.get(i);
             ListenersInfo b = listenersSecond.get(i);
-            boolean equal = a.container.getClass() == b.container.getClass()
-                    && a.containerListeners.length == b.containerListeners.length
-                    && a.lifecycleListeners.length == b.lifecycleListeners.length;
+            boolean equal = a.container.getClass() == b.container.getClass() &&
+                    a.containerListeners.length == b.containerListeners.length &&
+                    a.lifecycleListeners.length == b.lifecycleListeners.length;
             if (!equal) {
                 Assert.fail("The lists of listeners differ:\n" + a + "\n" + b);
             }
@@ -93,8 +89,7 @@ public class TestMapperListener extends TomcatBaseTest {
         public final ContainerListener[] containerListeners;
         public final LifecycleListener[] lifecycleListeners;
 
-        public ListenersInfo(Container container,
-                ContainerListener[] containerListeners,
+        public ListenersInfo(Container container, ContainerListener[] containerListeners,
                 LifecycleListener[] lifecycleListeners) {
             this.container = container;
             this.containerListeners = containerListeners;
@@ -104,23 +99,17 @@ public class TestMapperListener extends TomcatBaseTest {
         @Override
         public String toString() {
             StringBuilder buf = new StringBuilder();
-            buf.append("[container: \"").append(container)
-                    .append("\"\n containerListeners.length: ")
-                    .append(containerListeners.length)
-                    .append(", lifecycleListeners.length: ")
-                    .append(lifecycleListeners.length)
-                    .append("\n containerListeners: ")
-                    .append(Arrays.asList(containerListeners))
-                    .append("\n lifecycleListeners: ")
+            buf.append("[container: \"").append(container).append("\"\n containerListeners.length: ")
+                    .append(containerListeners.length).append(", lifecycleListeners.length: ")
+                    .append(lifecycleListeners.length).append("\n containerListeners: ")
+                    .append(Arrays.asList(containerListeners)).append("\n lifecycleListeners: ")
                     .append(Arrays.asList(lifecycleListeners)).append("\n]");
             return buf.toString();
         }
     }
 
-    private static void populateListenersInfo(List<ListenersInfo> list,
-            Container container) {
-        list.add(new ListenersInfo(container, container
-                .findContainerListeners(), container.findLifecycleListeners()));
+    private static void populateListenersInfo(List<ListenersInfo> list, Container container) {
+        list.add(new ListenersInfo(container, container.findContainerListeners(), container.findLifecycleListeners()));
         for (Container child : container.findChildren()) {
             populateListenersInfo(list, child);
         }
diff --git a/test/org/apache/catalina/mapper/TestMapperPerformance.java b/test/org/apache/catalina/mapper/TestMapperPerformance.java
index e31b7b0bae..606794397f 100644
--- a/test/org/apache/catalina/mapper/TestMapperPerformance.java
+++ b/test/org/apache/catalina/mapper/TestMapperPerformance.java
@@ -25,16 +25,8 @@ public class TestMapperPerformance extends TestMapper {
 
     @Test
     public void testPerformance() throws Exception {
-        String[] requestedHostNames = new String[] {
-                "xxxxxxxxxxx",
-                "iowejoiejfoiew",
-                "iowejoiejfoiex",
-                "owefojiwefoi",
-                "owefojiwefoix",
-                "qwerty.net",
-                "foo.net",
-                "zzz.com",
-                "abc.com"};
+        String[] requestedHostNames = new String[] { "xxxxxxxxxxx", "iowejoiejfoiew", "iowejoiejfoiex", "owefojiwefoi",
+                "owefojiwefoix", "qwerty.net", "foo.net", "zzz.com", "abc.com" };
 
         for (String requestedHostName : requestedHostNames) {
             testPerformance(requestedHostName);
diff --git a/test/org/apache/catalina/mapper/TestMapperWebapps.java b/test/org/apache/catalina/mapper/TestMapperWebapps.java
index 6ff6bda330..91262d6397 100644
--- a/test/org/apache/catalina/mapper/TestMapperWebapps.java
+++ b/test/org/apache/catalina/mapper/TestMapperWebapps.java
@@ -40,7 +40,7 @@ import org.apache.tomcat.websocket.server.WsContextListener;
 /**
  * Mapper tests that use real web applications on a running Tomcat.
  */
-public class TestMapperWebapps extends TomcatBaseTest{
+public class TestMapperWebapps extends TomcatBaseTest {
 
     @Test
     public void testContextRoot_Bug53339() throws Exception {
@@ -65,8 +65,7 @@ public class TestMapperWebapps extends TomcatBaseTest{
         private static final long serialVersionUID = 1L;
 
         @Override
-        protected void doGet(HttpServletRequest req, HttpServletResponse resp)
-                throws ServletException, IOException {
+        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
             // Confirm behaviour as per Servlet 12.2
             boolean pass = "/".equals(req.getPathInfo());
             if (pass) {
@@ -91,8 +90,7 @@ public class TestMapperWebapps extends TomcatBaseTest{
 
         File appDir = new File(getBuildDirectory(), "webapps/examples");
         // app dir is relative to server home
-        org.apache.catalina.Context ctxt  = tomcat.addWebapp(
-                null, "/examples", appDir.getAbsolutePath());
+        org.apache.catalina.Context ctxt = tomcat.addWebapp(null, "/examples", appDir.getAbsolutePath());
         ctxt.addApplicationListener(WsContextListener.class.getName());
         tomcat.start();
 
@@ -101,13 +99,11 @@ public class TestMapperWebapps extends TomcatBaseTest{
         ByteChunk res;
         String text;
 
-        res = getUrl("http://localhost:" + getPort()
-                + "/examples/servlets/servlet/HelloWorldExample");
+        res = getUrl("http://localhost:" + getPort() + "/examples/servlets/servlet/HelloWorldExample");
         text = res.toString();
         Assert.assertTrue(text, text.contains("<a href=\"../helloworld.html\">"));
 
-        res = getUrl("http://localhost:" + getPort()
-                + "/examples/jsp/jsp2/el/basic-arithmetic.jsp");
+        res = getUrl("http://localhost:" + getPort() + "/examples/jsp/jsp2/el/basic-arithmetic.jsp");
         text = res.toString();
         Assert.assertTrue(text, text.contains("<td>${(1==2) ? 3 : 4}</td>"));
 
@@ -116,32 +112,26 @@ public class TestMapperWebapps extends TomcatBaseTest{
         Assert.assertTrue(text, text.contains("<title>Apache Tomcat Examples</title>"));
 
         long timeA = System.currentTimeMillis();
-        res = getUrl("http://localhost:" + getPort()
-                + "/examples/jsp/include/include.jsp");
+        res = getUrl("http://localhost:" + getPort() + "/examples/jsp/include/include.jsp");
         String timestamp = findCommonPrefix(timeA, System.currentTimeMillis());
         text = res.toString();
-        Assert.assertTrue(text, text.contains(
-                "In place evaluation of another JSP which gives you the current time: " + timestamp));
-        Assert.assertTrue(text, text.contains(
-                "To get the current time in ms"));
-        Assert.assertTrue(text, text.contains(
-                "by including the output of another JSP: " + timestamp));
+        Assert.assertTrue(text,
+                text.contains("In place evaluation of another JSP which gives you the current time: " + timestamp));
+        Assert.assertTrue(text, text.contains("To get the current time in ms"));
+        Assert.assertTrue(text, text.contains("by including the output of another JSP: " + timestamp));
         Assert.assertTrue(text, text.contains(":-)"));
 
-        res = getUrl("http://localhost:" + getPort()
-                + "/examples/jsp/forward/forward.jsp");
+        res = getUrl("http://localhost:" + getPort() + "/examples/jsp/forward/forward.jsp");
         text = res.toString();
         Assert.assertTrue(text, text.contains("VM Memory usage"));
 
         ctxt.reload();
 
-        res = getUrl("http://localhost:" + getPort()
-                + "/examples/servlets/servlet/HelloWorldExample");
+        res = getUrl("http://localhost:" + getPort() + "/examples/servlets/servlet/HelloWorldExample");
         text = res.toString();
         Assert.assertTrue(text, text.contains("<a href=\"../helloworld.html\">"));
 
-        res = getUrl("http://localhost:" + getPort()
-                + "/examples/jsp/jsp2/el/basic-arithmetic.jsp");
+        res = getUrl("http://localhost:" + getPort() + "/examples/jsp/jsp2/el/basic-arithmetic.jsp");
         text = res.toString();
         Assert.assertTrue(text, text.contains("<td>${(1==2) ? 3 : 4}</td>"));
 
@@ -150,20 +140,16 @@ public class TestMapperWebapps extends TomcatBaseTest{
         Assert.assertTrue(text, text.contains("<title>Apache Tomcat Examples</title>"));
 
         timeA = System.currentTimeMillis();
-        res = getUrl("http://localhost:" + getPort()
-                + "/examples/jsp/include/include.jsp");
+        res = getUrl("http://localhost:" + getPort() + "/examples/jsp/include/include.jsp");
         timestamp = findCommonPrefix(timeA, System.currentTimeMillis());
         text = res.toString();
-        Assert.assertTrue(text, text.contains(
-                "In place evaluation of another JSP which gives you the current time: " + timestamp));
-        Assert.assertTrue(text, text.contains(
-                "To get the current time in ms"));
-        Assert.assertTrue(text, text.contains(
-                "by including the output of another JSP: " + timestamp));
+        Assert.assertTrue(text,
+                text.contains("In place evaluation of another JSP which gives you the current time: " + timestamp));
+        Assert.assertTrue(text, text.contains("To get the current time in ms"));
+        Assert.assertTrue(text, text.contains("by including the output of another JSP: " + timestamp));
         Assert.assertTrue(text, text.contains(":-)"));
 
-        res = getUrl("http://localhost:" + getPort()
-                + "/examples/jsp/forward/forward.jsp");
+        res = getUrl("http://localhost:" + getPort() + "/examples/jsp/forward/forward.jsp");
         text = res.toString();
         Assert.assertTrue(text, text.contains("VM Memory usage"));
     }
@@ -175,8 +161,7 @@ public class TestMapperWebapps extends TomcatBaseTest{
 
         File appDir = new File("test/webapp");
 
-        StandardContext ctxt = (StandardContext) tomcat.addWebapp(null, "/test",
-                appDir.getAbsolutePath());
+        StandardContext ctxt = (StandardContext) tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());
         ctxt.setReplaceWelcomeFiles(true);
         ctxt.addWelcomeFile("index.jsp");
         // Mapping for *.do is defined in web.xml
@@ -200,8 +185,7 @@ public class TestMapperWebapps extends TomcatBaseTest{
 
         File appDir = new File("test/webapp");
 
-        StandardContext ctxt = (StandardContext) tomcat.addWebapp(null, "/test",
-                appDir.getAbsolutePath());
+        StandardContext ctxt = (StandardContext) tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());
         ctxt.setReplaceWelcomeFiles(true);
         ctxt.addWelcomeFile("index.jsp");
         // Mapping for *.do is defined in web.xml
@@ -226,8 +210,7 @@ public class TestMapperWebapps extends TomcatBaseTest{
 
         // Use standard test webapp as ROOT
         File rootDir = new File("test/webapp");
-        org.apache.catalina.Context root =
-                tomcat.addWebapp(null, "", rootDir.getAbsolutePath());
+        org.apache.catalina.Context root = tomcat.addWebapp(null, "", rootDir.getAbsolutePath());
 
         // Add a security constraint
         SecurityConstraint constraint = new SecurityConstraint();
@@ -240,8 +223,7 @@ public class TestMapperWebapps extends TomcatBaseTest{
 
         // Also make examples available
         File examplesDir = new File(getBuildDirectory(), "webapps/examples");
-        org.apache.catalina.Context examples  = tomcat.addWebapp(
-                null, "/examples", examplesDir.getAbsolutePath());
+        org.apache.catalina.Context examples = tomcat.addWebapp(null, "/examples", examplesDir.getAbsolutePath());
         examples.setMapperContextRootRedirectEnabled(false);
         // Then block access to the examples to test redirection
         RemoteAddrValve rav = new RemoteAddrValve();
@@ -275,9 +257,8 @@ public class TestMapperWebapps extends TomcatBaseTest{
 
 
     /**
-     * Prepare a string to search in messages that contain a timestamp, when it
-     * is known that the timestamp was printed between {@code timeA} and
-     * {@code timeB}.
+     * Prepare a string to search in messages that contain a timestamp, when it is known that the timestamp was printed
+     * between {@code timeA} and {@code timeB}.
      */
     private static String findCommonPrefix(long timeA, long timeB) {
         while ((timeA != timeB) && timeA > 0) {


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


[tomcat] 02/02: Refactor to reduce code duplication

Posted by ma...@apache.org.
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 ba66bac46cbc8ef144461b8b6568c6231710e4fb
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Jan 27 12:57:10 2023 +0000

    Refactor to reduce code duplication
---
 .../annotation/TestServletSecurityMappings.java    | 51 +++-------------------
 1 file changed, 7 insertions(+), 44 deletions(-)

diff --git a/test/jakarta/servlet/annotation/TestServletSecurityMappings.java b/test/jakarta/servlet/annotation/TestServletSecurityMappings.java
index 3d4cfcf5c7..60440ea0fe 100644
--- a/test/jakarta/servlet/annotation/TestServletSecurityMappings.java
+++ b/test/jakarta/servlet/annotation/TestServletSecurityMappings.java
@@ -149,21 +149,21 @@ public class TestServletSecurityMappings extends TomcatBaseTest {
             if (secureRoot) {
                 sr = ctx.addServlet("Root", SecureRoot.class.getName());
             } else {
-                sr = ctx.addServlet("Root", Root.class.getName());
+                sr = ctx.addServlet("Root", Ok.class.getName());
             }
             sr.addMapping("");
 
             if (secureDefault) {
                 sr = ctx.addServlet("Default", SecureDefault.class.getName());
             } else {
-                sr = ctx.addServlet("Default", Default.class.getName());
+                sr = ctx.addServlet("Default", Ok.class.getName());
             }
             sr.addMapping("/");
 
             if (secureFoo) {
                 sr = ctx.addServlet("Foo", SecureFoo.class.getName());
             } else {
-                sr = ctx.addServlet("Foo", Foo.class.getName());
+                sr = ctx.addServlet("Foo", Ok.class.getName());
             }
             sr.addMapping("/foo");
         }
@@ -171,64 +171,27 @@ public class TestServletSecurityMappings extends TomcatBaseTest {
 
 
     @ServletSecurity(@HttpConstraint(ServletSecurity.EmptyRoleSemantic.DENY))
-    public static class SecureRoot extends HttpServlet {
+    public static class SecureRoot extends Ok {
 
         private static final long serialVersionUID = 1L;
-
-        @Override
-        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-            resp.getWriter().print("OK");
-        }
-    }
-
-
-    public static class Root extends HttpServlet {
-
-        private static final long serialVersionUID = 1L;
-
-        @Override
-        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-            resp.getWriter().print("OK");
-        }
     }
 
 
     @ServletSecurity(@HttpConstraint(ServletSecurity.EmptyRoleSemantic.DENY))
-    public static class SecureDefault extends HttpServlet {
+    public static class SecureDefault extends Ok {
 
         private static final long serialVersionUID = 1L;
-
-        @Override
-        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-            resp.getWriter().print("OK");
-        }
-    }
-
-
-    public static class Default extends HttpServlet {
-
-        private static final long serialVersionUID = 1L;
-
-        @Override
-        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-            resp.getWriter().print("OK");
-        }
     }
 
 
     @ServletSecurity(@HttpConstraint(ServletSecurity.EmptyRoleSemantic.DENY))
-    public static class SecureFoo extends HttpServlet {
+    public static class SecureFoo extends Ok {
 
         private static final long serialVersionUID = 1L;
-
-        @Override
-        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-            resp.getWriter().print("OK");
-        }
     }
 
 
-    public static class Foo extends HttpServlet {
+    public static class Ok extends HttpServlet {
 
         private static final long serialVersionUID = 1L;
 


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