This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 94b268b3b87a64ad57d9d05bc16ab95625600228 Author: Mark Thomas <ma...@apache.org> AuthorDate: Fri Jul 23 16:19:05 2021 +0100 Remove use of string constant for package name --- java/org/apache/catalina/core/ApplicationContext.java | 2 +- .../org/apache/catalina/core/ApplicationDispatcher.java | 2 +- .../apache/catalina/core/ApplicationFilterChain.java | 3 +-- .../apache/catalina/core/ApplicationFilterConfig.java | 3 +-- .../catalina/core/ApplicationFilterRegistration.java | 6 ++---- .../catalina/core/ApplicationServletRegistration.java | 6 ++---- .../catalina/core/ApplicationSessionCookieConfig.java | 3 +-- java/org/apache/catalina/core/AprLifecycleListener.java | 6 ++---- java/org/apache/catalina/core/AsyncContextImpl.java | 3 +-- java/org/apache/catalina/core/Constants.java | 4 ++++ java/org/apache/catalina/core/ContainerBase.java | 6 ++---- .../apache/catalina/core/DefaultInstanceManager.java | 3 +-- java/org/apache/catalina/core/JniLifecycleListener.java | 2 +- .../catalina/core/JreMemoryLeakPreventionListener.java | 6 ++---- java/org/apache/catalina/core/StandardHostValve.java | 14 +++----------- java/org/apache/catalina/core/StandardPipeline.java | 2 +- java/org/apache/catalina/core/StandardServer.java | 9 +-------- java/org/apache/catalina/core/StandardService.java | 7 +------ .../apache/catalina/core/StandardThreadExecutor.java | 3 +-- java/org/apache/catalina/core/StandardWrapperValve.java | 17 ++++++----------- .../core/ThreadLocalLeakPreventionListener.java | 3 +-- 21 files changed, 36 insertions(+), 74 deletions(-) diff --git a/java/org/apache/catalina/core/ApplicationContext.java b/java/org/apache/catalina/core/ApplicationContext.java index 9ec829a..1380913 100644 --- a/java/org/apache/catalina/core/ApplicationContext.java +++ b/java/org/apache/catalina/core/ApplicationContext.java @@ -180,7 +180,7 @@ public class ApplicationContext implements ServletContext { /** * The string manager for this package. */ - private static final StringManager sm = StringManager.getManager(Constants.Package); + private static final StringManager sm = StringManager.getManager(ApplicationContext.class); /** diff --git a/java/org/apache/catalina/core/ApplicationDispatcher.java b/java/org/apache/catalina/core/ApplicationDispatcher.java index 16647df..47f191f 100644 --- a/java/org/apache/catalina/core/ApplicationDispatcher.java +++ b/java/org/apache/catalina/core/ApplicationDispatcher.java @@ -270,7 +270,7 @@ final class ApplicationDispatcher implements AsyncDispatcher, RequestDispatcher /** * The StringManager for this package. */ - private static final StringManager sm = StringManager.getManager(Constants.Package); + private static final StringManager sm = StringManager.getManager(ApplicationDispatcher.class); /** diff --git a/java/org/apache/catalina/core/ApplicationFilterChain.java b/java/org/apache/catalina/core/ApplicationFilterChain.java index 9b7d4f5..642f69e 100644 --- a/java/org/apache/catalina/core/ApplicationFilterChain.java +++ b/java/org/apache/catalina/core/ApplicationFilterChain.java @@ -101,8 +101,7 @@ public final class ApplicationFilterChain implements FilterChain { /** * The string manager for our package. */ - private static final StringManager sm = - StringManager.getManager(Constants.Package); + private static final StringManager sm = StringManager.getManager(ApplicationFilterChain.class); /** diff --git a/java/org/apache/catalina/core/ApplicationFilterConfig.java b/java/org/apache/catalina/core/ApplicationFilterConfig.java index 86713a9..8ae9852 100644 --- a/java/org/apache/catalina/core/ApplicationFilterConfig.java +++ b/java/org/apache/catalina/core/ApplicationFilterConfig.java @@ -56,8 +56,7 @@ public final class ApplicationFilterConfig implements FilterConfig, Serializable private static final long serialVersionUID = 1L; - static final StringManager sm = - StringManager.getManager(Constants.Package); + static final StringManager sm = StringManager.getManager(ApplicationFilterConfig.class); private transient Log log = LogFactory.getLog(ApplicationFilterConfig.class); // must not be static diff --git a/java/org/apache/catalina/core/ApplicationFilterRegistration.java b/java/org/apache/catalina/core/ApplicationFilterRegistration.java index 8153d62..ef8fe60 100644 --- a/java/org/apache/catalina/core/ApplicationFilterRegistration.java +++ b/java/org/apache/catalina/core/ApplicationFilterRegistration.java @@ -32,14 +32,12 @@ import org.apache.tomcat.util.descriptor.web.FilterDef; import org.apache.tomcat.util.descriptor.web.FilterMap; import org.apache.tomcat.util.res.StringManager; -public class ApplicationFilterRegistration - implements FilterRegistration.Dynamic { +public class ApplicationFilterRegistration implements FilterRegistration.Dynamic { /** * The string manager for this package. */ - private static final StringManager sm = - StringManager.getManager(Constants.Package); + private static final StringManager sm = StringManager.getManager(ApplicationFilterRegistration.class); private final FilterDef filterDef; private final Context context; diff --git a/java/org/apache/catalina/core/ApplicationServletRegistration.java b/java/org/apache/catalina/core/ApplicationServletRegistration.java index 631a7be..c4d2c02 100644 --- a/java/org/apache/catalina/core/ApplicationServletRegistration.java +++ b/java/org/apache/catalina/core/ApplicationServletRegistration.java @@ -34,14 +34,12 @@ import org.apache.catalina.util.ParameterMap; import org.apache.tomcat.util.buf.UDecoder; import org.apache.tomcat.util.res.StringManager; -public class ApplicationServletRegistration - implements ServletRegistration.Dynamic { +public class ApplicationServletRegistration implements ServletRegistration.Dynamic { /** * The string manager for this package. */ - private static final StringManager sm = - StringManager.getManager(Constants.Package); + private static final StringManager sm = StringManager.getManager(ApplicationServletRegistration.class); private final Wrapper wrapper; private final Context context; diff --git a/java/org/apache/catalina/core/ApplicationSessionCookieConfig.java b/java/org/apache/catalina/core/ApplicationSessionCookieConfig.java index f36cdad..35a316a 100644 --- a/java/org/apache/catalina/core/ApplicationSessionCookieConfig.java +++ b/java/org/apache/catalina/core/ApplicationSessionCookieConfig.java @@ -29,8 +29,7 @@ public class ApplicationSessionCookieConfig implements SessionCookieConfig { /** * The string manager for this package. */ - private static final StringManager sm = StringManager - .getManager(Constants.Package); + private static final StringManager sm = StringManager.getManager(ApplicationSessionCookieConfig.class); private boolean httpOnly; private boolean secure; diff --git a/java/org/apache/catalina/core/AprLifecycleListener.java b/java/org/apache/catalina/core/AprLifecycleListener.java index b8ad718..ee2a648 100644 --- a/java/org/apache/catalina/core/AprLifecycleListener.java +++ b/java/org/apache/catalina/core/AprLifecycleListener.java @@ -41,8 +41,7 @@ import org.apache.tomcat.util.res.StringManager; * * @since 4.1 */ -public class AprLifecycleListener - implements LifecycleListener { +public class AprLifecycleListener implements LifecycleListener { private static final Log log = LogFactory.getLog(AprLifecycleListener.class); /** @@ -55,8 +54,7 @@ public class AprLifecycleListener /** * The string manager for this package. */ - protected static final StringManager sm = - StringManager.getManager(Constants.Package); + protected static final StringManager sm = StringManager.getManager(AprLifecycleListener.class); // ---------------------------------------------- Constants diff --git a/java/org/apache/catalina/core/AsyncContextImpl.java b/java/org/apache/catalina/core/AsyncContextImpl.java index d60643f..eb1dcce 100644 --- a/java/org/apache/catalina/core/AsyncContextImpl.java +++ b/java/org/apache/catalina/core/AsyncContextImpl.java @@ -53,8 +53,7 @@ public class AsyncContextImpl implements AsyncContext, AsyncContextCallback { private static final Log log = LogFactory.getLog(AsyncContextImpl.class); - protected static final StringManager sm = - StringManager.getManager(Constants.Package); + protected static final StringManager sm = StringManager.getManager(AsyncContextImpl.class); /* When a request uses a sequence of multiple start(); dispatch() with * non-container threads it is possible for a previous dispatch() to diff --git a/java/org/apache/catalina/core/Constants.java b/java/org/apache/catalina/core/Constants.java index 197e0c6..df3d889 100644 --- a/java/org/apache/catalina/core/Constants.java +++ b/java/org/apache/catalina/core/Constants.java @@ -18,6 +18,10 @@ package org.apache.catalina.core; public class Constants { + /** + * Unused. Will be removed in Apache Tomcat 10.1.x onwards. + */ + @Deprecated public static final String Package = "org.apache.catalina.core"; public static final int MAJOR_VERSION = 4; public static final int MINOR_VERSION = 0; diff --git a/java/org/apache/catalina/core/ContainerBase.java b/java/org/apache/catalina/core/ContainerBase.java index d7d6bac..2e3752f 100644 --- a/java/org/apache/catalina/core/ContainerBase.java +++ b/java/org/apache/catalina/core/ContainerBase.java @@ -126,8 +126,7 @@ import org.apache.tomcat.util.threads.InlineExecutorService; * * @author Craig R. McClanahan */ -public abstract class ContainerBase extends LifecycleMBeanBase - implements Container { +public abstract class ContainerBase extends LifecycleMBeanBase implements Container { private static final Log log = LogFactory.getLog(ContainerBase.class); @@ -241,8 +240,7 @@ public abstract class ContainerBase extends LifecycleMBeanBase /** * The string manager for this package. */ - protected static final StringManager sm = - StringManager.getManager(Constants.Package); + protected static final StringManager sm = StringManager.getManager(ContainerBase.class); /** diff --git a/java/org/apache/catalina/core/DefaultInstanceManager.java b/java/org/apache/catalina/core/DefaultInstanceManager.java index 259f4cf..ee966de 100644 --- a/java/org/apache/catalina/core/DefaultInstanceManager.java +++ b/java/org/apache/catalina/core/DefaultInstanceManager.java @@ -64,8 +64,7 @@ public class DefaultInstanceManager implements InstanceManager { /** * The string manager for this package. */ - protected static final StringManager sm = - StringManager.getManager(Constants.Package); + protected static final StringManager sm = StringManager.getManager(DefaultInstanceManager.class); private static final boolean EJB_PRESENT; private static final boolean JPA_PRESENT; diff --git a/java/org/apache/catalina/core/JniLifecycleListener.java b/java/org/apache/catalina/core/JniLifecycleListener.java index 15c59bd..8e129da 100644 --- a/java/org/apache/catalina/core/JniLifecycleListener.java +++ b/java/org/apache/catalina/core/JniLifecycleListener.java @@ -38,7 +38,7 @@ import org.apache.tomcat.util.res.StringManager; public class JniLifecycleListener implements LifecycleListener { private static final Log log = LogFactory.getLog(JniLifecycleListener.class); - protected static final StringManager sm = StringManager.getManager(Constants.Package); + protected static final StringManager sm = StringManager.getManager(JniLifecycleListener.class); private String libraryName = ""; private String libraryPath = ""; diff --git a/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java b/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java index d3a511e..b3c56a5 100644 --- a/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java +++ b/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java @@ -58,10 +58,8 @@ import org.w3c.dom.ls.DOMImplementationLS; */ public class JreMemoryLeakPreventionListener implements LifecycleListener { - private static final Log log = - LogFactory.getLog(JreMemoryLeakPreventionListener.class); - private static final StringManager sm = - StringManager.getManager(Constants.Package); + private static final Log log = LogFactory.getLog(JreMemoryLeakPreventionListener.class); + private static final StringManager sm = StringManager.getManager(JreMemoryLeakPreventionListener.class); private static final String FORK_JOIN_POOL_THREAD_FACTORY_PROPERTY = "java.util.concurrent.ForkJoinPool.common.threadFactory"; diff --git a/java/org/apache/catalina/core/StandardHostValve.java b/java/org/apache/catalina/core/StandardHostValve.java index 26e9f2a..9f96e7d 100644 --- a/java/org/apache/catalina/core/StandardHostValve.java +++ b/java/org/apache/catalina/core/StandardHostValve.java @@ -52,12 +52,12 @@ import org.apache.tomcat.util.res.StringManager; final class StandardHostValve extends ValveBase { private static final Log log = LogFactory.getLog(StandardHostValve.class); + private static final StringManager sm = StringManager.getManager(StandardHostValve.class); // Saves a call to getClassLoader() on very request. Under high load these // calls took just long enough to appear as a hot spot (although a very // minor one) in a profiler. - private static final ClassLoader MY_CLASSLOADER = - StandardHostValve.class.getClassLoader(); + private static final ClassLoader MY_CLASSLOADER = StandardHostValve.class.getClassLoader(); static final boolean STRICT_SERVLET_COMPLIANCE; @@ -76,20 +76,12 @@ final class StandardHostValve extends ValveBase { } //------------------------------------------------------ Constructor + public StandardHostValve() { super(true); } - // ----------------------------------------------------- Instance Variables - - /** - * The string manager for this package. - */ - private static final StringManager sm = - StringManager.getManager(Constants.Package); - - // --------------------------------------------------------- Public Methods /** diff --git a/java/org/apache/catalina/core/StandardPipeline.java b/java/org/apache/catalina/core/StandardPipeline.java index 7ffcb69..6673fed 100644 --- a/java/org/apache/catalina/core/StandardPipeline.java +++ b/java/org/apache/catalina/core/StandardPipeline.java @@ -52,7 +52,7 @@ import org.apache.tomcat.util.res.StringManager; public class StandardPipeline extends LifecycleBase implements Pipeline { private static final Log log = LogFactory.getLog(StandardPipeline.class); - private static final StringManager sm = StringManager.getManager(Constants.Package); + private static final StringManager sm = StringManager.getManager(StandardPipeline.class); // ----------------------------------------------------------- Constructors diff --git a/java/org/apache/catalina/core/StandardServer.java b/java/org/apache/catalina/core/StandardServer.java index 6ab79fc..d0ead54 100644 --- a/java/org/apache/catalina/core/StandardServer.java +++ b/java/org/apache/catalina/core/StandardServer.java @@ -71,11 +71,11 @@ import org.apache.tomcat.util.threads.TaskThreadFactory; public final class StandardServer extends LifecycleMBeanBase implements Server { private static final Log log = LogFactory.getLog(StandardServer.class); + private static final StringManager sm = StringManager.getManager(StandardServer.class); // ------------------------------------------------------------ Constructor - /** * Construct a default instance of this class. */ @@ -151,13 +151,6 @@ public final class StandardServer extends LifecycleMBeanBase implements Server { /** - * The string manager for this package. - */ - private static final StringManager sm = - StringManager.getManager(Constants.Package); - - - /** * The property change support for this component. */ final PropertyChangeSupport support = new PropertyChangeSupport(this); diff --git a/java/org/apache/catalina/core/StandardService.java b/java/org/apache/catalina/core/StandardService.java index 6a58e49..bdeb13e 100644 --- a/java/org/apache/catalina/core/StandardService.java +++ b/java/org/apache/catalina/core/StandardService.java @@ -51,6 +51,7 @@ import org.apache.tomcat.util.res.StringManager; public class StandardService extends LifecycleMBeanBase implements Service { private static final Log log = LogFactory.getLog(StandardService.class); + private static final StringManager sm = StringManager.getManager(StandardService.class); // ----------------------------------------------------- Instance Variables @@ -62,12 +63,6 @@ public class StandardService extends LifecycleMBeanBase implements Service { /** - * The string manager for this package. - */ - private static final StringManager sm = - StringManager.getManager(Constants.Package); - - /** * The <code>Server</code> that owns this Service, if any. */ private Server server = null; diff --git a/java/org/apache/catalina/core/StandardThreadExecutor.java b/java/org/apache/catalina/core/StandardThreadExecutor.java index 09ce5c6..2f8aaf4 100644 --- a/java/org/apache/catalina/core/StandardThreadExecutor.java +++ b/java/org/apache/catalina/core/StandardThreadExecutor.java @@ -31,8 +31,7 @@ import org.apache.tomcat.util.threads.ThreadPoolExecutor; public class StandardThreadExecutor extends LifecycleMBeanBase implements Executor, ResizableExecutor { - protected static final StringManager sm = - StringManager.getManager(Constants.Package); + protected static final StringManager sm = StringManager.getManager(StandardThreadExecutor.class); // ---------------------------------------------- Properties /** diff --git a/java/org/apache/catalina/core/StandardWrapperValve.java b/java/org/apache/catalina/core/StandardWrapperValve.java index a29c082..75e5f13 100644 --- a/java/org/apache/catalina/core/StandardWrapperValve.java +++ b/java/org/apache/catalina/core/StandardWrapperValve.java @@ -47,16 +47,19 @@ import org.apache.tomcat.util.res.StringManager; * * @author Craig R. McClanahan */ -final class StandardWrapperValve - extends ValveBase { +final class StandardWrapperValve extends ValveBase { + + private static final StringManager sm = StringManager.getManager(StandardWrapperValve.class); + //------------------------------------------------------ Constructor + public StandardWrapperValve() { super(true); } - // ----------------------------------------------------- Instance Variables + // ----------------------------------------------------- Instance Variables // Some JMX statistics. This valve is associated with a StandardWrapper. // We expose the StandardWrapper as JMX ( j2eeType=Servlet ). The fields @@ -68,16 +71,8 @@ final class StandardWrapperValve private final AtomicInteger errorCount = new AtomicInteger(0); - /** - * The string manager for this package. - */ - private static final StringManager sm = - StringManager.getManager(Constants.Package); - - // --------------------------------------------------------- Public Methods - /** * Invoke the servlet we are managing, respecting the rules regarding * servlet lifecycle and SingleThreadModel support. diff --git a/java/org/apache/catalina/core/ThreadLocalLeakPreventionListener.java b/java/org/apache/catalina/core/ThreadLocalLeakPreventionListener.java index 0e2d6e4..f13b19a 100644 --- a/java/org/apache/catalina/core/ThreadLocalLeakPreventionListener.java +++ b/java/org/apache/catalina/core/ThreadLocalLeakPreventionListener.java @@ -58,8 +58,7 @@ public class ThreadLocalLeakPreventionListener extends FrameworkListener { /** * The string manager for this package. */ - protected static final StringManager sm = - StringManager.getManager(Constants.Package); + protected static final StringManager sm = StringManager.getManager(ThreadLocalLeakPreventionListener.class); /** * Listens for {@link LifecycleEvent} for the start of the {@link Server} to --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org