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

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

commit 9e036a7a38c4e5ce242aae6be577e8c63191cd6a
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Mar 31 10:59:22 2020 +0100

    Group constants by type to aid maintenance
---
 java/org/apache/catalina/Globals.java | 268 ++++++++++++++++------------------
 1 file changed, 128 insertions(+), 140 deletions(-)

diff --git a/java/org/apache/catalina/Globals.java 
b/java/org/apache/catalina/Globals.java
index f8a2c80..144a028 100644
--- a/java/org/apache/catalina/Globals.java
+++ b/java/org/apache/catalina/Globals.java
@@ -23,119 +23,68 @@ package org.apache.catalina;
  */
 public final class Globals {
 
-    /**
-     * The servlet context attribute under which we store the alternate
-     * deployment descriptor for this web application
-     */
-    public static final String ALT_DD_ATTR =
-        "org.apache.catalina.deploy.alt_dd";
+    // ------------------------------------------------- Request attribute 
names
 
+    public static final String ASYNC_SUPPORTED_ATTR = 
"org.apache.catalina.ASYNC_SUPPORTED";
 
-    /**
-     * The request attribute under which we store the array of X509Certificate
-     * objects representing the certificate chain presented by our client,
-     * if any.
-     */
-    public static final String CERTIFICATES_ATTR =
-        "javax.servlet.request.X509Certificate";
 
-
-    /**
-     * The request attribute under which we store the name of the cipher suite
-     * being used on an SSL connection (as an object of type
-     * java.lang.String).
-     */
-    public static final String CIPHER_SUITE_ATTR =
-        "javax.servlet.request.cipher_suite";
+    public static final String GSS_CREDENTIAL_ATTR = 
"org.apache.catalina.realm.GSS_CREDENTIAL";
 
 
     /**
      * Request dispatcher state.
      */
-    public static final String DISPATCHER_TYPE_ATTR =
-        "org.apache.catalina.core.DISPATCHER_TYPE";
+    public static final String DISPATCHER_TYPE_ATTR = 
"org.apache.catalina.core.DISPATCHER_TYPE";
 
 
     /**
      * Request dispatcher path.
      */
-    public static final String DISPATCHER_REQUEST_PATH_ATTR =
-        "org.apache.catalina.core.DISPATCHER_REQUEST_PATH";
-
-
-    /**
-     * The WebResourceRoot which is associated with the context. This can be
-     * used to manipulate static files.
-     */
-    public static final String RESOURCES_ATTR =
-        "org.apache.catalina.resources";
-
-
-    /**
-     * The servlet context attribute under which we store the class path
-     * for our application class loader (as an object of type String),
-     * delimited with the appropriate path delimiter for this platform.
-     */
-    public static final String CLASS_PATH_ATTR =
-        "org.apache.catalina.jsp_classpath";
-
-
-    /**
-     * The request attribute under which we store the key size being used for
-     * this SSL connection (as an object of type java.lang.Integer).
-     */
-    public static final String KEY_SIZE_ATTR =
-        "javax.servlet.request.key_size";
+    public static final String DISPATCHER_REQUEST_PATH_ATTR = 
"org.apache.catalina.core.DISPATCHER_REQUEST_PATH";
 
 
     /**
-     * The request attribute under which we store the session id being used
-     * for this SSL connection (as an object of type java.lang.String).
+     * The request attribute under which we store the servlet name on a
+     * named dispatcher request.
      */
-    public static final String SSL_SESSION_ID_ATTR =
-        "javax.servlet.request.ssl_session_id";
+    public static final String NAMED_DISPATCHER_ATTR = 
"org.apache.catalina.NAMED";
 
 
     /**
-     * The request attribute key for the session manager.
-     * This one is a Tomcat extension to the Servlet spec.
+     * The request attribute that is set to {@code Boolean.TRUE} if some 
request
+     * parameters have been ignored during request parameters parsing. It can
+     * happen, for example, if there is a limit on the total count of parseable
+     * parameters, or if parameter cannot be decoded, or any other error
+     * happened during parameter parsing.
      */
-    public static final String SSL_SESSION_MGR_ATTR =
-        "javax.servlet.request.ssl_session_mgr";
+    public static final String PARAMETER_PARSE_FAILED_ATTR = 
"org.apache.catalina.parameter_parse_failed";
 
 
     /**
-     * The request attribute under which we store the servlet name on a
-     * named dispatcher request.
+     * The reason that the parameter parsing failed.
      */
-    public static final String NAMED_DISPATCHER_ATTR =
-        "org.apache.catalina.NAMED";
+    public static final String PARAMETER_PARSE_FAILED_REASON_ATTR = 
"org.apache.catalina.parameter_parse_failed_reason";
 
 
     /**
-     * The servlet context attribute under which we store a flag used
-     * to mark this request as having been processed by the SSIServlet.
-     * We do this because of the pathInfo mangling happening when using
-     * the CGIServlet in conjunction with the SSI servlet. (value stored
-     * as an object of type String)
+     * The request attribute set by the RemoteIpFilter, RemoteIpValve (and may
+     * be set by other similar components) that identifies for the connector 
the
+     * remote IP address claimed to be associated with this request when a
+     * request is received via one or more proxies. It is typically provided 
via
+     * the X-Forwarded-For HTTP header.
      *
-     * @deprecated Unused. This is no longer used as the CGIO servlet now has
-     *             generic handling for when it is used as an include.
-     *             This will be removed in Tomcat 10
+     * Duplicated here for neater code in the catalina packages.
      */
-    @Deprecated
-    public static final String SSI_FLAG_ATTR = 
"org.apache.catalina.ssi.SSIServlet";
+    public static final String REMOTE_ADDR_ATTRIBUTE = 
org.apache.coyote.Constants.REMOTE_ADDR_ATTRIBUTE;
 
 
     /**
      * The subject under which the AccessControlContext is running.
+     * The request attribute that is set to the value of {@code Boolean.TRUE}
+     * by the RemoteIpFilter, RemoteIpValve (and other similar components) 
that identifies
+     * a request which been forwarded via one or more proxies.
      */
-    public static final String SUBJECT_ATTR =
-        "javax.security.auth.subject";
-
-
-    public static final String GSS_CREDENTIAL_ATTR =
-        "org.apache.catalina.realm.GSS_CREDENTIAL";
+    public static final String REQUEST_FORWARDED_ATTRIBUTE = 
"org.apache.tomcat.request.forwarded";
 
 
     /**
@@ -144,8 +93,7 @@ public final class Globals {
      *
      * Duplicated here for neater code in the catalina packages.
      */
-    public static final String SENDFILE_SUPPORTED_ATTR =
-            org.apache.coyote.Constants.SENDFILE_SUPPORTED_ATTR;
+    public static final String SENDFILE_SUPPORTED_ATTR = 
org.apache.coyote.Constants.SENDFILE_SUPPORTED_ATTR;
 
 
     /**
@@ -156,8 +104,7 @@ public final class Globals {
      *
      * Duplicated here for neater code in the catalina packages.
      */
-    public static final String SENDFILE_FILENAME_ATTR =
-            org.apache.coyote.Constants.SENDFILE_FILENAME_ATTR;
+    public static final String SENDFILE_FILENAME_ATTR = 
org.apache.coyote.Constants.SENDFILE_FILENAME_ATTR;
 
 
     /**
@@ -169,8 +116,7 @@ public final class Globals {
      *
      * Duplicated here for neater code in the catalina packages.
      */
-    public static final String SENDFILE_FILE_START_ATTR =
-            org.apache.coyote.Constants.SENDFILE_FILE_START_ATTR;
+    public static final String SENDFILE_FILE_START_ATTR = 
org.apache.coyote.Constants.SENDFILE_FILE_START_ATTR;
 
 
     /**
@@ -182,97 +128,118 @@ public final class Globals {
      *
      * Duplicated here for neater code in the catalina packages.
      */
-    public static final String SENDFILE_FILE_END_ATTR =
-            org.apache.coyote.Constants.SENDFILE_FILE_END_ATTR;
+    public static final String SENDFILE_FILE_END_ATTR = 
org.apache.coyote.Constants.SENDFILE_FILE_END_ATTR;
 
 
     /**
-     * The request attribute set by the RemoteIpFilter, RemoteIpValve (and may
-     * be set by other similar components) that identifies for the connector 
the
-     * remote IP address claimed to be associated with this request when a
-     * request is received via one or more proxies. It is typically provided 
via
-     * the X-Forwarded-For HTTP header.
-     *
-     * Duplicated here for neater code in the catalina packages.
+     * The request attribute under which we store the array of X509Certificate
+     * objects representing the certificate chain presented by our client,
+     * if any.
      */
-    public static final String REMOTE_ADDR_ATTRIBUTE =
-            org.apache.coyote.Constants.REMOTE_ADDR_ATTRIBUTE;
+    public static final String CERTIFICATES_ATTR = 
"jakarta.servlet.request.X509Certificate";
 
 
     /**
-     * The request attribute that is set to the value of {@code Boolean.TRUE}
-     * by the RemoteIpFilter, RemoteIpValve (and other similar components) 
that identifies
-     * a request which been forwarded via one or more proxies.
+     * The request attribute under which we store the name of the cipher suite
+     * being used on an SSL connection (as an object of type
+     * java.lang.String).
      */
-    public static final String REQUEST_FORWARDED_ATTRIBUTE =
-        "org.apache.tomcat.request.forwarded";
+    public static final String CIPHER_SUITE_ATTR = 
"jakarta.servlet.request.cipher_suite";
 
 
-    public static final String ASYNC_SUPPORTED_ATTR =
-        "org.apache.catalina.ASYNC_SUPPORTED";
+    /**
+     * The request attribute under which we store the key size being used for
+     * this SSL connection (as an object of type java.lang.Integer).
+     */
+    public static final String KEY_SIZE_ATTR = 
"jakarta.servlet.request.key_size";
 
 
     /**
-     * The request attribute that is set to {@code Boolean.TRUE} if some 
request
-     * parameters have been ignored during request parameters parsing. It can
-     * happen, for example, if there is a limit on the total count of parseable
-     * parameters, or if parameter cannot be decoded, or any other error
-     * happened during parameter parsing.
+     * The request attribute under which we store the session id being used
+     * for this SSL connection (as an object of type java.lang.String).
      */
-    public static final String PARAMETER_PARSE_FAILED_ATTR =
-        "org.apache.catalina.parameter_parse_failed";
+    public static final String SSL_SESSION_ID_ATTR = 
"jakarta.servlet.request.ssl_session_id";
 
 
     /**
-     * The reason that the parameter parsing failed.
+     * The request attribute key for the session manager.
+     * This one is a Tomcat extension to the Servlet spec.
      */
-    public static final String PARAMETER_PARSE_FAILED_REASON_ATTR =
-            "org.apache.catalina.parameter_parse_failed_reason";
+    public static final String SSL_SESSION_MGR_ATTR = 
"jakarta.servlet.request.ssl_session_mgr";
+
 
+    // ------------------------------------------------- Session attribute 
names
 
     /**
-     * The master flag which controls strict servlet specification
-     * compliance.
+     * The subject under which the AccessControlContext is running.
      */
-    public static final boolean STRICT_SERVLET_COMPLIANCE =
-        
Boolean.parseBoolean(System.getProperty("org.apache.catalina.STRICT_SERVLET_COMPLIANCE",
 "false"));
+    public static final String SUBJECT_ATTR = "javax.security.auth.subject";
+
 
+    // ------------------------------------------ ServletContext attribute 
names
 
     /**
-     * Has security been turned on?
+     * The servlet context attribute under which we store the alternate
+     * deployment descriptor for this web application
      */
-    public static final boolean IS_SECURITY_ENABLED =
-        (System.getSecurityManager() != null);
+    public static final String ALT_DD_ATTR = 
"org.apache.catalina.deploy.alt_dd";
 
 
     /**
-     * Default domain for MBeans if none can be determined
+     * The servlet context attribute under which we store the class path
+     * for our application class loader (as an object of type String),
+     * delimited with the appropriate path delimiter for this platform.
      */
-    public static final String DEFAULT_MBEAN_DOMAIN = "Catalina";
+    public static final String CLASS_PATH_ATTR =  
"org.apache.catalina.jsp_classpath";
 
 
     /**
-     * Name of the system property containing
-     * the tomcat product installation path
+     * Name of the ServletContext attribute under which we store the context
+     * Realm's CredentialHandler (if both the Realm and the CredentialHandler
+     * exist).
      */
-    public static final String CATALINA_HOME_PROP = "catalina.home";
+    public static final String CREDENTIAL_HANDLER = 
"org.apache.catalina.CredentialHandler";
 
 
     /**
-     * Name of the system property containing
-     * the tomcat instance installation path
+     * The WebResourceRoot which is associated with the context. This can be
+     * used to manipulate static files.
      */
-    public static final String CATALINA_BASE_PROP = "catalina.base";
+    public static final String RESOURCES_ATTR = 
"org.apache.catalina.resources";
 
 
     /**
+     * Name of the ServletContext attribute under which we store the web
+     * application version string (the text that appears after ## when parallel
+     * deployment is used).
+     */
+    public static final String WEBAPP_VERSION = 
"org.apache.catalina.webappVersion";
+
+
+    /**
+     * The servlet context attribute under which we store a flag used
+     * to mark this request as having been processed by the SSIServlet.
+     * We do this because of the pathInfo mangling happening when using
+     * the CGIServlet in conjunction with the SSI servlet. (value stored
+     * as an object of type String)
+     *
+     * @deprecated Unused. This is no longer used as the CGIO servlet now has
+     *             generic handling for when it is used as an include.
+     *             This will be removed in Tomcat 10
+     */
+    @Deprecated
+    public static final String SSI_FLAG_ATTR = 
"org.apache.catalina.ssi.SSIServlet";
+
+
+    // --------------------------- ServletContext initialisation parameter 
names
+
+    /**
      * Name of the ServletContext init-param that determines if the JSP engine
      * should validate *.tld files when parsing them.
      * <p>
      * This must be kept in sync with org.apache.jasper.Constants
      */
-    public static final String JASPER_XML_VALIDATION_TLD_INIT_PARAM =
-            "org.apache.jasper.XML_VALIDATE_TLD";
+    public static final String JASPER_XML_VALIDATION_TLD_INIT_PARAM = 
"org.apache.jasper.XML_VALIDATE_TLD";
 
 
     /**
@@ -282,22 +249,43 @@ public final class Globals {
      * <p>
      * This must be kept in sync with org.apache.jasper.Constants
      */
-    public static final String JASPER_XML_BLOCK_EXTERNAL_INIT_PARAM =
-            "org.apache.jasper.XML_BLOCK_EXTERNAL";
+    public static final String JASPER_XML_BLOCK_EXTERNAL_INIT_PARAM = 
"org.apache.jasper.XML_BLOCK_EXTERNAL";
+
+
+    // --------------------------------------------------- System property 
names
 
     /**
-     * Name of the ServletContext attribute under which we store the context
-     * Realm's CredentialHandler (if both the Realm and the CredentialHandler
-     * exist).
+     * Name of the system property containing
+     * the tomcat product installation path
      */
-    public static final String CREDENTIAL_HANDLER
-            = "org.apache.catalina.CredentialHandler";
+    public static final String CATALINA_HOME_PROP = "catalina.home";
 
 
     /**
-     * Name of the ServletContext attribute under which we store the web
-     * application version string (the text that appears after ## when parallel
-     * deployment is used).
+     * Name of the system property containing
+     * the tomcat instance installation path
      */
-    public static final String WEBAPP_VERSION = 
"org.apache.catalina.webappVersion";
+    public static final String CATALINA_BASE_PROP = "catalina.base";
+
+
+    // -------------------------------------------------------- Global 
constants
+
+    /**
+     * The master flag which controls strict servlet specification
+     * compliance.
+     */
+    public static final boolean STRICT_SERVLET_COMPLIANCE =
+            
Boolean.parseBoolean(System.getProperty("org.apache.catalina.STRICT_SERVLET_COMPLIANCE",
 "false"));
+
+
+    /**
+     * Has security been turned on?
+     */
+    public static final boolean IS_SECURITY_ENABLED = 
(System.getSecurityManager() != null);
+
+
+    /**
+     * Default domain for MBeans if none can be determined
+     */
+    public static final String DEFAULT_MBEAN_DOMAIN = "Catalina";
 }


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

Reply via email to