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 1e0c67b624188945a498f5519f481c0ae9d6039d Author: Mark Thomas <ma...@apache.org> AuthorDate: Wed Jun 14 12:19:46 2023 +0100 Code clean-up - formatting. No functional change. --- .../apache/catalina/core/ApplicationContext.java | 24 +++--- .../catalina/core/ApplicationContextFacade.java | 12 +-- .../catalina/core/ApplicationDispatcher.java | 8 +- .../catalina/core/ApplicationFilterChain.java | 8 +- .../catalina/core/ApplicationFilterConfig.java | 8 +- .../catalina/core/ApplicationFilterFactory.java | 8 +- .../core/ApplicationFilterRegistration.java | 10 +-- .../catalina/core/ApplicationHttpRequest.java | 20 ++--- java/org/apache/catalina/core/ApplicationPart.java | 2 +- .../catalina/core/ApplicationPushBuilder.java | 8 +- .../apache/catalina/core/ApplicationRequest.java | 14 ++-- .../core/ApplicationServletRegistration.java | 10 +-- .../org/apache/catalina/core/AsyncContextImpl.java | 4 +- java/org/apache/catalina/core/ContainerBase.java | 2 +- .../catalina/core/ContextNamingInfoListener.java | 13 ++-- .../catalina/core/DefaultInstanceManager.java | 38 +++++----- .../core/JreMemoryLeakPreventionListener.java | 12 +-- .../catalina/core/NamingContextListener.java | 12 +-- java/org/apache/catalina/core/StandardContext.java | 86 +++++++++++----------- java/org/apache/catalina/core/StandardHost.java | 4 +- java/org/apache/catalina/core/StandardWrapper.java | 4 +- 21 files changed, 155 insertions(+), 152 deletions(-) diff --git a/java/org/apache/catalina/core/ApplicationContext.java b/java/org/apache/catalina/core/ApplicationContext.java index 7abd09995d..1e33f41dbd 100644 --- a/java/org/apache/catalina/core/ApplicationContext.java +++ b/java/org/apache/catalina/core/ApplicationContext.java @@ -95,8 +95,8 @@ public class ApplicationContext implements ServletContext { static { STRICT_SERVLET_COMPLIANCE = Globals.STRICT_SERVLET_COMPLIANCE; - String requireSlash = System - .getProperty("org.apache.catalina.core.ApplicationContext.GET_RESOURCE_REQUIRE_SLASH"); + String requireSlash = + System.getProperty("org.apache.catalina.core.ApplicationContext.GET_RESOURCE_REQUIRE_SLASH"); if (requireSlash == null) { GET_RESOURCE_REQUIRE_SLASH = STRICT_SERVLET_COMPLIANCE; } else { @@ -129,13 +129,13 @@ public class ApplicationContext implements ServletContext { /** * The context attributes for this context. */ - protected Map<String, Object> attributes = new ConcurrentHashMap<>(); + protected Map<String,Object> attributes = new ConcurrentHashMap<>(); /** * List of read only attributes for this context. */ - private final Map<String, String> readOnlyAttributes = new ConcurrentHashMap<>(); + private final Map<String,String> readOnlyAttributes = new ConcurrentHashMap<>(); /** @@ -171,7 +171,7 @@ public class ApplicationContext implements ServletContext { /** * The merged context initialization parameters for this Context. */ - private final ConcurrentMap<String, String> parameters = new ConcurrentHashMap<>(); + private final ConcurrentMap<String,String> parameters = new ConcurrentHashMap<>(); /** @@ -854,7 +854,7 @@ public class ApplicationContext implements ServletContext { } String jspServletClassName = null; - Map<String, String> jspFileInitParams = new HashMap<>(); + Map<String,String> jspFileInitParams = new HashMap<>(); Wrapper jspServlet = (Wrapper) context.findChild("jsp"); @@ -881,7 +881,7 @@ public class ApplicationContext implements ServletContext { private ServletRegistration.Dynamic addServlet(String servletName, String servletClass, Servlet servlet, - Map<String, String> initParams) throws IllegalStateException { + Map<String,String> initParams) throws IllegalStateException { if (servletName == null || servletName.equals("")) { throw new IllegalArgumentException(sm.getString("applicationContext.invalidServletName", servletName)); @@ -924,7 +924,7 @@ public class ApplicationContext implements ServletContext { } if (initParams != null) { - for (Map.Entry<String, String> initParam : initParams.entrySet()) { + for (Map.Entry<String,String> initParam : initParams.entrySet()) { wrapper.addInitParameter(initParam.getKey(), initParam.getValue()); } } @@ -1191,8 +1191,8 @@ public class ApplicationContext implements ServletContext { @Override - public Map<String, ? extends FilterRegistration> getFilterRegistrations() { - Map<String, ApplicationFilterRegistration> result = new HashMap<>(); + public Map<String,? extends FilterRegistration> getFilterRegistrations() { + Map<String,ApplicationFilterRegistration> result = new HashMap<>(); FilterDef[] filterDefs = context.findFilterDefs(); for (FilterDef filterDef : filterDefs) { @@ -1210,8 +1210,8 @@ public class ApplicationContext implements ServletContext { @Override - public Map<String, ? extends ServletRegistration> getServletRegistrations() { - Map<String, ApplicationServletRegistration> result = new HashMap<>(); + public Map<String,? extends ServletRegistration> getServletRegistrations() { + Map<String,ApplicationServletRegistration> result = new HashMap<>(); Container[] wrappers = context.findChildren(); for (Container wrapper : wrappers) { diff --git a/java/org/apache/catalina/core/ApplicationContextFacade.java b/java/org/apache/catalina/core/ApplicationContextFacade.java index 76ca50f852..cde889a013 100644 --- a/java/org/apache/catalina/core/ApplicationContextFacade.java +++ b/java/org/apache/catalina/core/ApplicationContextFacade.java @@ -60,13 +60,13 @@ public class ApplicationContextFacade implements ServletContext { /** * Cache Class object used for reflection. */ - private final Map<String, Class<?>[]> classCache; + private final Map<String,Class<?>[]> classCache; /** * Cache method object. */ - private final Map<String, Method> objectCache; + private final Map<String,Method> objectCache; // ----------------------------------------------------------- Constructors @@ -688,9 +688,9 @@ public class ApplicationContextFacade implements ServletContext { @Override @SuppressWarnings("unchecked") // doPrivileged() returns the correct type - public Map<String, ? extends FilterRegistration> getFilterRegistrations() { + public Map<String,? extends FilterRegistration> getFilterRegistrations() { if (SecurityUtil.isPackageProtectionEnabled()) { - return (Map<String, ? extends FilterRegistration>) doPrivileged("getFilterRegistrations", null); + return (Map<String,? extends FilterRegistration>) doPrivileged("getFilterRegistrations", null); } else { return context.getFilterRegistrations(); } @@ -709,9 +709,9 @@ public class ApplicationContextFacade implements ServletContext { @Override @SuppressWarnings("unchecked") // doPrivileged() returns the correct type - public Map<String, ? extends ServletRegistration> getServletRegistrations() { + public Map<String,? extends ServletRegistration> getServletRegistrations() { if (SecurityUtil.isPackageProtectionEnabled()) { - return (Map<String, ? extends ServletRegistration>) doPrivileged("getServletRegistrations", null); + return (Map<String,? extends ServletRegistration>) doPrivileged("getServletRegistrations", null); } else { return context.getServletRegistrations(); } diff --git a/java/org/apache/catalina/core/ApplicationDispatcher.java b/java/org/apache/catalina/core/ApplicationDispatcher.java index 6686820ae8..7b631c5f35 100644 --- a/java/org/apache/catalina/core/ApplicationDispatcher.java +++ b/java/org/apache/catalina/core/ApplicationDispatcher.java @@ -194,8 +194,8 @@ final class ApplicationDispatcher implements AsyncDispatcher, RequestDispatcher * @param mapping The mapping for this resource (if any) * @param name Servlet name (if a named dispatcher was created) else <code>null</code> */ - ApplicationDispatcher(Wrapper wrapper, String requestURI, String servletPath, String pathInfo, - String queryString, ApplicationMappingImpl mapping, String name) { + ApplicationDispatcher(Wrapper wrapper, String requestURI, String servletPath, String pathInfo, String queryString, + ApplicationMappingImpl mapping, String name) { super(); @@ -647,8 +647,8 @@ final class ApplicationDispatcher implements AsyncDispatcher, RequestDispatcher } catch (Throwable e) { ExceptionUtils.handleThrowable(e); wrapper.getLogger().error(sm.getString("applicationDispatcher.allocateException", wrapper.getName()), e); - servletException = new ServletException( - sm.getString("applicationDispatcher.allocateException", wrapper.getName()), e); + servletException = + new ServletException(sm.getString("applicationDispatcher.allocateException", wrapper.getName()), e); servlet = null; } diff --git a/java/org/apache/catalina/core/ApplicationFilterChain.java b/java/org/apache/catalina/core/ApplicationFilterChain.java index c10e4eaa24..d94101c93d 100644 --- a/java/org/apache/catalina/core/ApplicationFilterChain.java +++ b/java/org/apache/catalina/core/ApplicationFilterChain.java @@ -104,14 +104,14 @@ public final class ApplicationFilterChain implements FilterChain { /** * Static class array used when the SecurityManager is turned on and <code>doFilter</code> is invoked. */ - private static final Class<?>[] classType = new Class[] { ServletRequest.class, ServletResponse.class, - FilterChain.class }; + private static final Class<?>[] classType = + new Class[] { ServletRequest.class, ServletResponse.class, FilterChain.class }; /** * Static class array used when the SecurityManager is turned on and <code>service</code> is invoked. */ - private static final Class<?>[] classTypeUsedInService = new Class[] { ServletRequest.class, - ServletResponse.class }; + private static final Class<?>[] classTypeUsedInService = + new Class[] { ServletRequest.class, ServletResponse.class }; // ---------------------------------------------------- FilterChain Methods diff --git a/java/org/apache/catalina/core/ApplicationFilterConfig.java b/java/org/apache/catalina/core/ApplicationFilterConfig.java index 1c00cf00bc..e3122b56ef 100644 --- a/java/org/apache/catalina/core/ApplicationFilterConfig.java +++ b/java/org/apache/catalina/core/ApplicationFilterConfig.java @@ -163,7 +163,7 @@ public final class ApplicationFilterConfig implements FilterConfig, Serializable @Override public String getInitParameter(String name) { - Map<String, String> map = filterDef.getParameterMap(); + Map<String,String> map = filterDef.getParameterMap(); if (map == null) { return null; } @@ -178,7 +178,7 @@ public final class ApplicationFilterConfig implements FilterConfig, Serializable */ @Override public Enumeration<String> getInitParameterNames() { - Map<String, String> map = filterDef.getParameterMap(); + Map<String,String> map = filterDef.getParameterMap(); if (map == null) { return Collections.enumeration(emptyString); @@ -215,7 +215,7 @@ public final class ApplicationFilterConfig implements FilterConfig, Serializable // --------------------------------------------------------- Public Methods - public Map<String, String> getFilterInitParameterMap() { + public Map<String,String> getFilterInitParameterMap() { return Collections.unmodifiableMap(filterDef.getParameterMap()); } @@ -329,7 +329,7 @@ public final class ApplicationFilterConfig implements FilterConfig, Serializable if (context instanceof StandardContext) { instanceManager = ((StandardContext) context).getInstanceManager(); } else { - instanceManager = new DefaultInstanceManager(null, new HashMap<String, Map<String, String>>(), context, + instanceManager = new DefaultInstanceManager(null, new HashMap<String,Map<String,String>>(), context, getClass().getClassLoader()); } } diff --git a/java/org/apache/catalina/core/ApplicationFilterFactory.java b/java/org/apache/catalina/core/ApplicationFilterFactory.java index daea8d7746..3c3ea43c76 100644 --- a/java/org/apache/catalina/core/ApplicationFilterFactory.java +++ b/java/org/apache/catalina/core/ApplicationFilterFactory.java @@ -104,8 +104,8 @@ public final class ApplicationFilterFactory { if (!matchFiltersURL(filterMap, requestPath)) { continue; } - ApplicationFilterConfig filterConfig = (ApplicationFilterConfig) context - .findFilterConfig(filterMap.getFilterName()); + ApplicationFilterConfig filterConfig = + (ApplicationFilterConfig) context.findFilterConfig(filterMap.getFilterName()); if (filterConfig == null) { // FIXME - log configuration problem continue; @@ -121,8 +121,8 @@ public final class ApplicationFilterFactory { if (!matchFiltersServlet(filterMap, servletName)) { continue; } - ApplicationFilterConfig filterConfig = (ApplicationFilterConfig) context - .findFilterConfig(filterMap.getFilterName()); + ApplicationFilterConfig filterConfig = + (ApplicationFilterConfig) context.findFilterConfig(filterMap.getFilterName()); if (filterConfig == null) { // FIXME - log configuration problem continue; diff --git a/java/org/apache/catalina/core/ApplicationFilterRegistration.java b/java/org/apache/catalina/core/ApplicationFilterRegistration.java index c1f5714385..60a8dfe913 100644 --- a/java/org/apache/catalina/core/ApplicationFilterRegistration.java +++ b/java/org/apache/catalina/core/ApplicationFilterRegistration.java @@ -145,8 +145,8 @@ public class ApplicationFilterRegistration implements FilterRegistration.Dynamic } @Override - public Map<String, String> getInitParameters() { - ParameterMap<String, String> result = new ParameterMap<>(); + public Map<String,String> getInitParameters() { + ParameterMap<String,String> result = new ParameterMap<>(); result.putAll(filterDef.getParameterMap()); result.setLocked(true); return result; @@ -173,11 +173,11 @@ public class ApplicationFilterRegistration implements FilterRegistration.Dynamic } @Override - public Set<String> setInitParameters(Map<String, String> initParameters) { + public Set<String> setInitParameters(Map<String,String> initParameters) { Set<String> conflicts = new HashSet<>(); - for (Map.Entry<String, String> entry : initParameters.entrySet()) { + for (Map.Entry<String,String> entry : initParameters.entrySet()) { if (entry.getKey() == null || entry.getValue() == null) { throw new IllegalArgumentException( sm.getString("applicationFilterRegistration.nullInitParams", entry.getKey(), entry.getValue())); @@ -189,7 +189,7 @@ public class ApplicationFilterRegistration implements FilterRegistration.Dynamic // Have to add in a separate loop since spec requires no updates at all // if there is an issue - for (Map.Entry<String, String> entry : initParameters.entrySet()) { + for (Map.Entry<String,String> entry : initParameters.entrySet()) { setInitParameter(entry.getKey(), entry.getValue()); } diff --git a/java/org/apache/catalina/core/ApplicationHttpRequest.java b/java/org/apache/catalina/core/ApplicationHttpRequest.java index 2bb1f7f990..20c0bd74b9 100644 --- a/java/org/apache/catalina/core/ApplicationHttpRequest.java +++ b/java/org/apache/catalina/core/ApplicationHttpRequest.java @@ -70,13 +70,13 @@ class ApplicationHttpRequest extends HttpServletRequestWrapper { /** * The set of attribute names that are special for request dispatchers. */ - protected static final String specials[] = { RequestDispatcher.INCLUDE_REQUEST_URI, - RequestDispatcher.INCLUDE_CONTEXT_PATH, RequestDispatcher.INCLUDE_SERVLET_PATH, - RequestDispatcher.INCLUDE_PATH_INFO, RequestDispatcher.INCLUDE_QUERY_STRING, - ApplicationDispatcher.INCLUDE_MAPPING, RequestDispatcher.FORWARD_REQUEST_URI, - RequestDispatcher.FORWARD_CONTEXT_PATH, RequestDispatcher.FORWARD_SERVLET_PATH, - RequestDispatcher.FORWARD_PATH_INFO, RequestDispatcher.FORWARD_QUERY_STRING, - ApplicationDispatcher.FORWARD_MAPPING }; + protected static final String specials[] = + { RequestDispatcher.INCLUDE_REQUEST_URI, RequestDispatcher.INCLUDE_CONTEXT_PATH, + RequestDispatcher.INCLUDE_SERVLET_PATH, RequestDispatcher.INCLUDE_PATH_INFO, + RequestDispatcher.INCLUDE_QUERY_STRING, ApplicationDispatcher.INCLUDE_MAPPING, + RequestDispatcher.FORWARD_REQUEST_URI, RequestDispatcher.FORWARD_CONTEXT_PATH, + RequestDispatcher.FORWARD_SERVLET_PATH, RequestDispatcher.FORWARD_PATH_INFO, + RequestDispatcher.FORWARD_QUERY_STRING, ApplicationDispatcher.FORWARD_MAPPING }; private static final int SPECIALS_FIRST_FORWARD_INDEX = 6; @@ -131,7 +131,7 @@ class ApplicationHttpRequest extends HttpServletRequestWrapper { /** * The request parameters for this request. This is initialized from the wrapped request. */ - protected Map<String, String[]> parameters = null; + protected Map<String,String[]> parameters = null; /** @@ -396,7 +396,7 @@ class ApplicationHttpRequest extends HttpServletRequestWrapper { * Override the <code>getParameterMap()</code> method of the wrapped request. */ @Override - public Map<String, String[]> getParameterMap() { + public Map<String,String[]> getParameterMap() { parseParameters(); return parameters; } @@ -731,7 +731,7 @@ class ApplicationHttpRequest extends HttpServletRequestWrapper { parameters = new ParameterMap<>(); parameters.putAll(getRequest().getParameterMap()); mergeParameters(); - ((ParameterMap<String, String[]>) parameters).setLocked(true); + ((ParameterMap<String,String[]>) parameters).setLocked(true); parsedParams = true; } diff --git a/java/org/apache/catalina/core/ApplicationPart.java b/java/org/apache/catalina/core/ApplicationPart.java index b21b8a7de0..d808cb818f 100644 --- a/java/org/apache/catalina/core/ApplicationPart.java +++ b/java/org/apache/catalina/core/ApplicationPart.java @@ -137,7 +137,7 @@ public class ApplicationPart implements Part { ParameterParser paramParser = new ParameterParser(); paramParser.setLowerCaseNames(true); // Parameter parser can handle null input - Map<String, String> params = paramParser.parse(cd, ';'); + Map<String,String> params = paramParser.parse(cd, ';'); if (params.containsKey("filename")) { fileName = params.get("filename"); // The parser will remove surrounding '"' but will not diff --git a/java/org/apache/catalina/core/ApplicationPushBuilder.java b/java/org/apache/catalina/core/ApplicationPushBuilder.java index f823ac3d1e..8169d026bb 100644 --- a/java/org/apache/catalina/core/ApplicationPushBuilder.java +++ b/java/org/apache/catalina/core/ApplicationPushBuilder.java @@ -67,7 +67,7 @@ public class ApplicationPushBuilder { private final boolean addSessionCookie; private final boolean addSessionPathParameter; - private final Map<String, List<String>> headers = new CaseInsensitiveKeyMap<>(); + private final Map<String,List<String>> headers = new CaseInsensitiveKeyMap<>(); private final List<Cookie> cookies = new ArrayList<>(); private String method = "GET"; private String path; @@ -128,8 +128,8 @@ public class ApplicationPushBuilder { sessionId = request.getRequestedSessionId(); } if (!request.isRequestedSessionIdFromCookie() && !request.isRequestedSessionIdFromURL() && sessionId != null) { - Set<SessionTrackingMode> sessionTrackingModes = request.getServletContext() - .getEffectiveSessionTrackingModes(); + Set<SessionTrackingMode> sessionTrackingModes = + request.getServletContext().getEffectiveSessionTrackingModes(); addSessionCookie = sessionTrackingModes.contains(SessionTrackingMode.COOKIE); addSessionPathParameter = sessionTrackingModes.contains(SessionTrackingMode.URL); } else { @@ -299,7 +299,7 @@ public class ApplicationPushBuilder { pushTarget.scheme().setString(baseRequest.getScheme()); // Copy headers - for (Map.Entry<String, List<String>> header : headers.entrySet()) { + for (Map.Entry<String,List<String>> header : headers.entrySet()) { for (String value : header.getValue()) { pushTarget.getMimeHeaders().addValue(header.getKey()).setString(value); } diff --git a/java/org/apache/catalina/core/ApplicationRequest.java b/java/org/apache/catalina/core/ApplicationRequest.java index e91c64cb6f..6a5a7bae2f 100644 --- a/java/org/apache/catalina/core/ApplicationRequest.java +++ b/java/org/apache/catalina/core/ApplicationRequest.java @@ -47,12 +47,12 @@ class ApplicationRequest extends ServletRequestWrapper { /** * The set of attribute names that are special for request dispatchers. */ - protected static final String specials[] = { RequestDispatcher.INCLUDE_REQUEST_URI, - RequestDispatcher.INCLUDE_CONTEXT_PATH, RequestDispatcher.INCLUDE_SERVLET_PATH, - RequestDispatcher.INCLUDE_PATH_INFO, RequestDispatcher.INCLUDE_QUERY_STRING, - RequestDispatcher.FORWARD_REQUEST_URI, RequestDispatcher.FORWARD_CONTEXT_PATH, - RequestDispatcher.FORWARD_SERVLET_PATH, RequestDispatcher.FORWARD_PATH_INFO, - RequestDispatcher.FORWARD_QUERY_STRING }; + protected static final String specials[] = + { RequestDispatcher.INCLUDE_REQUEST_URI, RequestDispatcher.INCLUDE_CONTEXT_PATH, + RequestDispatcher.INCLUDE_SERVLET_PATH, RequestDispatcher.INCLUDE_PATH_INFO, + RequestDispatcher.INCLUDE_QUERY_STRING, RequestDispatcher.FORWARD_REQUEST_URI, + RequestDispatcher.FORWARD_CONTEXT_PATH, RequestDispatcher.FORWARD_SERVLET_PATH, + RequestDispatcher.FORWARD_PATH_INFO, RequestDispatcher.FORWARD_QUERY_STRING }; // ----------------------------------------------------------- Constructors @@ -77,7 +77,7 @@ class ApplicationRequest extends ServletRequestWrapper { /** * The request attributes for this request. This is initialized from the wrapped request, but updates are allowed. */ - protected final HashMap<String, Object> attributes = new HashMap<>(); + protected final HashMap<String,Object> attributes = new HashMap<>(); // ------------------------------------------------- ServletRequest Methods diff --git a/java/org/apache/catalina/core/ApplicationServletRegistration.java b/java/org/apache/catalina/core/ApplicationServletRegistration.java index 9a0d3c96e7..5cfc1337d2 100644 --- a/java/org/apache/catalina/core/ApplicationServletRegistration.java +++ b/java/org/apache/catalina/core/ApplicationServletRegistration.java @@ -62,8 +62,8 @@ public class ApplicationServletRegistration implements ServletRegistration.Dynam } @Override - public Map<String, String> getInitParameters() { - ParameterMap<String, String> result = new ParameterMap<>(); + public Map<String,String> getInitParameters() { + ParameterMap<String,String> result = new ParameterMap<>(); String[] parameterNames = wrapper.findInitParameters(); @@ -96,11 +96,11 @@ public class ApplicationServletRegistration implements ServletRegistration.Dynam } @Override - public Set<String> setInitParameters(Map<String, String> initParameters) { + public Set<String> setInitParameters(Map<String,String> initParameters) { Set<String> conflicts = new HashSet<>(); - for (Map.Entry<String, String> entry : initParameters.entrySet()) { + for (Map.Entry<String,String> entry : initParameters.entrySet()) { if (entry.getKey() == null || entry.getValue() == null) { throw new IllegalArgumentException( sm.getString("applicationFilterRegistration.nullInitParams", entry.getKey(), entry.getValue())); @@ -113,7 +113,7 @@ public class ApplicationServletRegistration implements ServletRegistration.Dynam // Have to add in a separate loop since spec requires no updates at all // if there is an issue if (conflicts.isEmpty()) { - for (Map.Entry<String, String> entry : initParameters.entrySet()) { + for (Map.Entry<String,String> entry : initParameters.entrySet()) { setInitParameter(entry.getKey(), entry.getValue()); } } diff --git a/java/org/apache/catalina/core/AsyncContextImpl.java b/java/org/apache/catalina/core/AsyncContextImpl.java index 17c96c7fce..c7a8f1d878 100644 --- a/java/org/apache/catalina/core/AsyncContextImpl.java +++ b/java/org/apache/catalina/core/AsyncContextImpl.java @@ -386,8 +386,8 @@ public class AsyncContextImpl implements AsyncContext, AsyncContextCallback { if (log.isDebugEnabled()) { log.debug(sm.getString("asyncContextImpl.fireOnError")); } - AsyncEvent errorEvent = new AsyncEvent(event.getAsyncContext(), event.getSuppliedRequest(), - event.getSuppliedResponse(), t); + AsyncEvent errorEvent = + new AsyncEvent(event.getAsyncContext(), event.getSuppliedRequest(), event.getSuppliedResponse(), t); List<AsyncListenerWrapper> listenersCopy = new ArrayList<>(listeners); for (AsyncListenerWrapper listener : listenersCopy) { try { diff --git a/java/org/apache/catalina/core/ContainerBase.java b/java/org/apache/catalina/core/ContainerBase.java index 8e5390d092..da690e37cd 100644 --- a/java/org/apache/catalina/core/ContainerBase.java +++ b/java/org/apache/catalina/core/ContainerBase.java @@ -152,7 +152,7 @@ public abstract class ContainerBase extends LifecycleMBeanBase implements Contai /** * The child Containers belonging to this Container, keyed by name. */ - protected final HashMap<String, Container> children = new HashMap<>(); + protected final HashMap<String,Container> children = new HashMap<>(); /** diff --git a/java/org/apache/catalina/core/ContextNamingInfoListener.java b/java/org/apache/catalina/core/ContextNamingInfoListener.java index b77915c7d7..c6706c27d6 100644 --- a/java/org/apache/catalina/core/ContextNamingInfoListener.java +++ b/java/org/apache/catalina/core/ContextNamingInfoListener.java @@ -26,8 +26,7 @@ import org.apache.tomcat.util.descriptor.web.ContextEnvironment; import org.apache.tomcat.util.res.StringManager; /** - * Implementation of {@code LifecycleListener} that will create context naming information - * environment entries. + * Implementation of {@code LifecycleListener} that will create context naming information environment entries. * <p> * This listener must only be nested within {@link Context} elements. * <p> @@ -41,8 +40,8 @@ import org.apache.tomcat.util.res.StringManager; * <li>Display Name: {@code context/displayName} from {@link Context#getDisplayName()}</li> * </ul> * <p> - * See the <a href="https://tomcat.apache.org/tomcat-8.5-doc/config/context.html#Naming">Tomcat - * documentation</a> for more details on the values. + * See the <a href="https://tomcat.apache.org/tomcat-8.5-doc/config/context.html#Naming">Tomcat documentation</a> for + * more details on the values. */ public class ContextNamingInfoListener implements LifecycleListener { @@ -62,8 +61,8 @@ public class ContextNamingInfoListener implements LifecycleListener { private boolean emptyOnRoot = true; /** - * Sets whether for the root context {@code context/path} and {@code context/encodedPath} will - * contain {@code "/"} and {@code context/name} will contain {@code "ROOT"} with a version, if any. + * Sets whether for the root context {@code context/path} and {@code context/encodedPath} will contain {@code "/"} + * and {@code context/name} will contain {@code "ROOT"} with a version, if any. * * @param emptyOnRoot whether paths and name for root context shall be empty */ @@ -113,7 +112,7 @@ public class ContextNamingInfoListener implements LifecycleListener { ce.setType("java.lang.String"); ce.setValue(value); if (log.isDebugEnabled()) { - log.info(sm.getString("contextNamingInfoListener.envEntry",name, value)); + log.info(sm.getString("contextNamingInfoListener.envEntry", name, value)); } context.getNamingResources().addEnvironment(ce); } diff --git a/java/org/apache/catalina/core/DefaultInstanceManager.java b/java/org/apache/catalina/core/DefaultInstanceManager.java index 9063613d45..ac31544a9b 100644 --- a/java/org/apache/catalina/core/DefaultInstanceManager.java +++ b/java/org/apache/catalina/core/DefaultInstanceManager.java @@ -97,17 +97,18 @@ public class DefaultInstanceManager implements InstanceManager { private final Context context; - private final Map<String, Map<String, String>> injectionMap; + private final Map<String,Map<String,String>> injectionMap; protected final ClassLoader classLoader; protected final ClassLoader containerClassLoader; protected final boolean privileged; protected final boolean ignoreAnnotations; private final Set<String> restrictedClasses; - private final ManagedConcurrentWeakHashMap<Class<?>, AnnotationCacheEntry[]> annotationCache = new ManagedConcurrentWeakHashMap<>(); - private final Map<String, String> postConstructMethods; - private final Map<String, String> preDestroyMethods; + private final ManagedConcurrentWeakHashMap<Class<?>,AnnotationCacheEntry[]> annotationCache = + new ManagedConcurrentWeakHashMap<>(); + private final Map<String,String> postConstructMethods; + private final Map<String,String> preDestroyMethods; - public DefaultInstanceManager(Context context, Map<String, Map<String, String>> injectionMap, + public DefaultInstanceManager(Context context, Map<String,Map<String,String>> injectionMap, org.apache.catalina.Context catalinaContext, ClassLoader containerClassLoader) { classLoader = catalinaContext.getLoader().getClassLoader(); privileged = catalinaContext.getPrivileged(); @@ -158,7 +159,7 @@ public class DefaultInstanceManager implements InstanceManager { private Object newInstance(Object instance, Class<?> clazz) throws IllegalAccessException, InvocationTargetException, NamingException { if (!ignoreAnnotations) { - Map<String, String> injections = assembleInjectionsFromClassHierarchy(clazz); + Map<String,String> injections = assembleInjectionsFromClassHierarchy(clazz); populateAnnotationsCache(clazz, injections); processAnnotations(instance, injections); postConstruct(instance, clazz); @@ -166,9 +167,9 @@ public class DefaultInstanceManager implements InstanceManager { return instance; } - private Map<String, String> assembleInjectionsFromClassHierarchy(Class<?> clazz) { - Map<String, String> injections = new HashMap<>(); - Map<String, String> currentInjections = null; + private Map<String,String> assembleInjectionsFromClassHierarchy(Class<?> clazz) { + Map<String,String> injections = new HashMap<>(); + Map<String,String> currentInjections = null; while (clazz != null) { currentInjections = this.injectionMap.get(clazz.getName()); if (currentInjections != null) { @@ -272,7 +273,7 @@ public class DefaultInstanceManager implements InstanceManager { * @throws javax.naming.NamingException if value cannot be looked up in jndi * @throws java.lang.reflect.InvocationTargetException if injection fails */ - protected void populateAnnotationsCache(Class<?> clazz, Map<String, String> injections) + protected void populateAnnotationsCache(Class<?> clazz, Map<String,String> injections) throws IllegalAccessException, InvocationTargetException, NamingException { List<AnnotationCacheEntry> annotations = null; @@ -320,8 +321,8 @@ public class DefaultInstanceManager implements InstanceManager { (webServiceRefAnnotation = method.getAnnotation(WebServiceRef.class)) != null) { annotations.add(new AnnotationCacheEntry(method.getName(), method.getParameterTypes(), ((WebServiceRef) webServiceRefAnnotation).name(), AnnotationCacheEntryType.SETTER)); - } else if (JPA_PRESENT && (persistenceContextAnnotation = method - .getAnnotation(PersistenceContext.class)) != null) { + } else if (JPA_PRESENT && (persistenceContextAnnotation = + method.getAnnotation(PersistenceContext.class)) != null) { annotations.add(new AnnotationCacheEntry(method.getName(), method.getParameterTypes(), ((PersistenceContext) persistenceContextAnnotation).name(), AnnotationCacheEntryType.SETTER)); @@ -378,8 +379,8 @@ public class DefaultInstanceManager implements InstanceManager { (webServiceRefAnnotation = field.getAnnotation(WebServiceRef.class)) != null) { annotations.add(new AnnotationCacheEntry(fieldName, null, ((WebServiceRef) webServiceRefAnnotation).name(), AnnotationCacheEntryType.FIELD)); - } else if (JPA_PRESENT && (persistenceContextAnnotation = field - .getAnnotation(PersistenceContext.class)) != null) { + } else if (JPA_PRESENT && (persistenceContextAnnotation = + field.getAnnotation(PersistenceContext.class)) != null) { annotations.add(new AnnotationCacheEntry(fieldName, null, ((PersistenceContext) persistenceContextAnnotation).name(), AnnotationCacheEntryType.FIELD)); @@ -417,7 +418,7 @@ public class DefaultInstanceManager implements InstanceManager { * @throws javax.naming.NamingException if value cannot be looked up in jndi * @throws java.lang.reflect.InvocationTargetException if injection fails */ - protected void processAnnotations(Object instance, Map<String, String> injections) + protected void processAnnotations(Object instance, Map<String,String> injections) throws IllegalAccessException, InvocationTargetException, NamingException { if (context == null) { @@ -583,7 +584,7 @@ public class DefaultInstanceManager implements InstanceManager { if (properties.isEmpty()) { return; } - for (Map.Entry<Object, Object> e : properties.entrySet()) { + for (Map.Entry<Object,Object> e : properties.entrySet()) { if ("restricted".equals(e.getValue())) { classNames.add(e.getKey().toString()); } else { @@ -693,7 +694,10 @@ public class DefaultInstanceManager implements InstanceManager { private enum AnnotationCacheEntryType { - FIELD, SETTER, POST_CONSTRUCT, PRE_DESTROY + FIELD, + SETTER, + POST_CONSTRUCT, + PRE_DESTROY } diff --git a/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java b/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java index a7cf157d06..02a4b73f26 100644 --- a/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java +++ b/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java @@ -61,7 +61,8 @@ public class JreMemoryLeakPreventionListener implements LifecycleListener { 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"; + private static final String FORK_JOIN_POOL_THREAD_FACTORY_PROPERTY = + "java.util.concurrent.ForkJoinPool.common.threadFactory"; /** * Protect against the memory leak caused when the first call to <code>sun.awt.AppContext.getAppContext()</code> is * triggered by a web application. Defaults to <code>false</code> since @@ -331,8 +332,8 @@ public class JreMemoryLeakPreventionListener implements LifecycleListener { } else { log.debug(sm.getString("jreLeakListener.gcDaemonFail"), e); } - } catch (SecurityException | NoSuchMethodException | IllegalArgumentException - | IllegalAccessException e) { + } catch (SecurityException | NoSuchMethodException | IllegalArgumentException | + IllegalAccessException e) { log.error(sm.getString("jreLeakListener.gcDaemonFail"), e); } catch (InvocationTargetException e) { ExceptionUtils.handleThrowable(e.getCause()); @@ -466,9 +467,8 @@ public class JreMemoryLeakPreventionListener implements LifecycleListener { } /* - * Initialize the SeedGenerator of the JVM, as some platforms use - * a thread which could end up being associated with a webapp rather - * than the container. + * Initialize the SeedGenerator of the JVM, as some platforms use a thread which could end up being + * associated with a webapp rather than the container. */ if (initSeedGenerator) { SecureRandom.getSeed(1); diff --git a/java/org/apache/catalina/core/NamingContextListener.java b/java/org/apache/catalina/core/NamingContextListener.java index deff7e8252..cabebd4271 100644 --- a/java/org/apache/catalina/core/NamingContextListener.java +++ b/java/org/apache/catalina/core/NamingContextListener.java @@ -138,7 +138,7 @@ public class NamingContextListener implements LifecycleListener, ContainerListen /** * Objectnames Map. */ - protected HashMap<String, ObjectName> objectNames = new HashMap<>(); + protected HashMap<String,ObjectName> objectNames = new HashMap<>(); /** @@ -224,7 +224,7 @@ public class NamingContextListener implements LifecycleListener, ContainerListen } try { - Hashtable<String, Object> contextEnv = new Hashtable<>(); + Hashtable<String,Object> contextEnv = new Hashtable<>(); namingContext = new NamingContext(contextEnv, getName()); ContextAccessController.setSecurityToken(getName(), token); ContextAccessController.setSecurityToken(container, token); @@ -867,8 +867,8 @@ public class NamingContextListener implements LifecycleListener, ContainerListen } if (jaxrpcURL == null) { try { - jaxrpcURL = ((Context) container).getServletContext() - .getResource(service.getJaxrpcmappingfile()); + jaxrpcURL = + ((Context) container).getServletContext().getResource(service.getJaxrpcmappingfile()); } catch (MalformedURLException e) { // Ignore and carry on } @@ -1040,8 +1040,8 @@ public class NamingContextListener implements LifecycleListener, ContainerListen public void addResourceLink(ContextResourceLink resourceLink) { // Create a reference to the resource. - Reference ref = new ResourceLinkRef(resourceLink.getType(), resourceLink.getGlobal(), resourceLink.getFactory(), - null); + Reference ref = + new ResourceLinkRef(resourceLink.getType(), resourceLink.getGlobal(), resourceLink.getFactory(), null); Iterator<String> i = resourceLink.listProperties(); while (i.hasNext()) { String key = i.next(); diff --git a/java/org/apache/catalina/core/StandardContext.java b/java/org/apache/catalina/core/StandardContext.java index 1912529d2f..6228132444 100644 --- a/java/org/apache/catalina/core/StandardContext.java +++ b/java/org/apache/catalina/core/StandardContext.java @@ -232,7 +232,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat /** * The ordered set of ServletContainerInitializers for this web application. */ - private Map<ServletContainerInitializer, Set<Class<?>>> initializers = new LinkedHashMap<>(); + private Map<ServletContainerInitializer,Set<Class<?>>> initializers = new LinkedHashMap<>(); /** @@ -362,13 +362,13 @@ public class StandardContext extends ContainerBase implements Context, Notificat /** * The set of filter configurations (and associated filter instances) we have initialized, keyed by filter name. */ - private HashMap<String, ApplicationFilterConfig> filterConfigs = new HashMap<>(); + private HashMap<String,ApplicationFilterConfig> filterConfigs = new HashMap<>(); /** * The set of filter definitions for this application, keyed by filter name. */ - private HashMap<String, FilterDef> filterDefs = new HashMap<>(); + private HashMap<String,FilterDef> filterDefs = new HashMap<>(); /** @@ -418,19 +418,19 @@ public class StandardContext extends ContainerBase implements Context, Notificat /** * The message destinations for this web application. */ - private HashMap<String, MessageDestination> messageDestinations = new HashMap<>(); + private HashMap<String,MessageDestination> messageDestinations = new HashMap<>(); /** * The MIME mappings for this web application, keyed by extension. */ - private HashMap<String, String> mimeMappings = new HashMap<>(); + private HashMap<String,String> mimeMappings = new HashMap<>(); /** * The context initialization parameters for this web application, keyed by name. */ - private final ConcurrentMap<String, String> parameters = new ConcurrentHashMap<>(); + private final ConcurrentMap<String,String> parameters = new ConcurrentHashMap<>(); /** @@ -493,7 +493,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat /** * The security role mappings for this application, keyed by role name (as used within the application). */ - private HashMap<String, String> roleMappings = new HashMap<>(); + private HashMap<String,String> roleMappings = new HashMap<>(); /** @@ -507,7 +507,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat /** * The servlet mappings for this web application, keyed by matching pattern. */ - private HashMap<String, String> servletMappings = new HashMap<>(); + private HashMap<String,String> servletMappings = new HashMap<>(); private final Object servletMappingsLock = new Object(); @@ -751,8 +751,8 @@ public class StandardContext extends ContainerBase implements Context, Notificat private boolean jndiExceptionOnFailedWrite = true; - private Map<String, String> postConstructMethods = new HashMap<>(); - private Map<String, String> preDestroyMethods = new HashMap<>(); + private Map<String,String> postConstructMethods = new HashMap<>(); + private Map<String,String> preDestroyMethods = new HashMap<>(); private String containerSciFilter; @@ -4334,7 +4334,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat boolean ok = true; synchronized (filterConfigs) { filterConfigs.clear(); - for (Entry<String, FilterDef> entry : filterDefs.entrySet()) { + for (Entry<String,FilterDef> entry : filterDefs.entrySet()) { String name = entry.getKey(); if (getLogger().isDebugEnabled()) { getLogger().debug(" Starting filter '" + name + "'"); @@ -4368,7 +4368,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat // Release all Filter and FilterConfig instances synchronized (filterConfigs) { - for (Entry<String, ApplicationFilterConfig> entry : filterConfigs.entrySet()) { + for (Entry<String,ApplicationFilterConfig> entry : filterConfigs.entrySet()) { if (getLogger().isDebugEnabled()) { getLogger().debug(" Stopping filter '" + entry.getKey() + "'"); } @@ -4653,7 +4653,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat public boolean loadOnStartup(Container children[]) { // Collect "load on startup" servlets that need to be initialized - TreeMap<Integer, ArrayList<Wrapper>> map = new TreeMap<>(); + TreeMap<Integer,ArrayList<Wrapper>> map = new TreeMap<>(); for (Container child : children) { Wrapper wrapper = (Wrapper) child; int loadOnStartup = wrapper.getLoadOnStartup(); @@ -4709,8 +4709,8 @@ public class StandardContext extends ContainerBase implements Context, Notificat // Send j2ee.state.starting notification if (this.getObjectName() != null) { - Notification notification = new Notification("j2ee.state.starting", this.getObjectName(), - sequenceNumber.getAndIncrement()); + Notification notification = + new Notification("j2ee.state.starting", this.getObjectName(), sequenceNumber.getAndIncrement()); broadcaster.sendNotification(notification); } @@ -4916,7 +4916,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat if (isUseNaming() && getNamingContextListener() != null) { context = getNamingContextListener().getEnvContext(); } - Map<String, Map<String, String>> injectionMap = buildInjectionMap( + Map<String,Map<String,String>> injectionMap = buildInjectionMap( getIgnoreAnnotations() ? new NamingResourcesImpl() : getNamingResources()); setInstanceManager( new DefaultInstanceManager(context, injectionMap, this, this.getClass().getClassLoader())); @@ -4935,7 +4935,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat mergeParameters(); // Call ServletContainerInitializers - for (Map.Entry<ServletContainerInitializer, Set<Class<?>>> entry : initializers.entrySet()) { + for (Map.Entry<ServletContainerInitializer,Set<Class<?>>> entry : initializers.entrySet()) { try { entry.getKey().onStartup(entry.getValue(), getServletContext()); } catch (ServletException e) { @@ -5007,8 +5007,8 @@ public class StandardContext extends ContainerBase implements Context, Notificat // Send j2ee.state.running notification if (ok && (this.getObjectName() != null)) { - Notification notification = new Notification("j2ee.state.running", this.getObjectName(), - sequenceNumber.getAndIncrement()); + Notification notification = + new Notification("j2ee.state.running", this.getObjectName(), sequenceNumber.getAndIncrement()); broadcaster.sendNotification(notification); } @@ -5023,8 +5023,8 @@ public class StandardContext extends ContainerBase implements Context, Notificat setState(LifecycleState.FAILED); // Send j2ee.object.failed notification if (this.getObjectName() != null) { - Notification notification = new Notification("j2ee.object.failed", this.getObjectName(), - sequenceNumber.getAndIncrement()); + Notification notification = + new Notification("j2ee.object.failed", this.getObjectName(), sequenceNumber.getAndIncrement()); broadcaster.sendNotification(notification); } } else { @@ -5034,16 +5034,16 @@ public class StandardContext extends ContainerBase implements Context, Notificat private void checkConstraintsForUncoveredMethods(SecurityConstraint[] constraints) { - SecurityConstraint[] newConstraints = SecurityConstraint.findUncoveredHttpMethods(constraints, - getDenyUncoveredHttpMethods(), getLogger()); + SecurityConstraint[] newConstraints = + SecurityConstraint.findUncoveredHttpMethods(constraints, getDenyUncoveredHttpMethods(), getLogger()); for (SecurityConstraint constraint : newConstraints) { addConstraint(constraint); } } - private Map<String, Map<String, String>> buildInjectionMap(NamingResourcesImpl namingResources) { - Map<String, Map<String, String>> injectionMap = new HashMap<>(); + private Map<String,Map<String,String>> buildInjectionMap(NamingResourcesImpl namingResources) { + Map<String,Map<String,String>> injectionMap = new HashMap<>(); for (Injectable resource : namingResources.findLocalEjbs()) { addInjectionTarget(resource, injectionMap); } @@ -5068,13 +5068,13 @@ public class StandardContext extends ContainerBase implements Context, Notificat return injectionMap; } - private void addInjectionTarget(Injectable resource, Map<String, Map<String, String>> injectionMap) { + private void addInjectionTarget(Injectable resource, Map<String,Map<String,String>> injectionMap) { List<InjectionTarget> injectionTargets = resource.getInjectionTargets(); if (injectionTargets != null && injectionTargets.size() > 0) { String jndiName = resource.getName(); for (InjectionTarget injectionTarget : injectionTargets) { String clazz = injectionTarget.getTargetClass(); - Map<String, String> injections = injectionMap.get(clazz); + Map<String,String> injections = injectionMap.get(clazz); if (injections == null) { injections = new HashMap<>(); injectionMap.put(clazz, injections); @@ -5091,7 +5091,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat * the application parameters appropriately. */ private void mergeParameters() { - Map<String, String> mergedParams = new HashMap<>(); + Map<String,String> mergedParams = new HashMap<>(); String names[] = findParameters(); for (String s : names) { @@ -5110,7 +5110,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat } ServletContext sc = getServletContext(); - for (Map.Entry<String, String> entry : mergedParams.entrySet()) { + for (Map.Entry<String,String> entry : mergedParams.entrySet()) { sc.setInitParameter(entry.getKey(), entry.getValue()); } @@ -5129,8 +5129,8 @@ public class StandardContext extends ContainerBase implements Context, Notificat // Send j2ee.state.stopping notification if (this.getObjectName() != null) { - Notification notification = new Notification("j2ee.state.stopping", this.getObjectName(), - sequenceNumber.getAndIncrement()); + Notification notification = + new Notification("j2ee.state.stopping", this.getObjectName(), sequenceNumber.getAndIncrement()); broadcaster.sendNotification(notification); } @@ -5230,8 +5230,8 @@ public class StandardContext extends ContainerBase implements Context, Notificat // Send j2ee.state.stopped notification if (this.getObjectName() != null) { - Notification notification = new Notification("j2ee.state.stopped", this.getObjectName(), - sequenceNumber.getAndIncrement()); + Notification notification = + new Notification("j2ee.state.stopped", this.getObjectName(), sequenceNumber.getAndIncrement()); broadcaster.sendNotification(notification); } @@ -5267,8 +5267,8 @@ public class StandardContext extends ContainerBase implements Context, Notificat // have been set so the notification can't be created if (getObjectName() != null) { // Send j2ee.object.deleted notification - Notification notification = new Notification("j2ee.object.deleted", this.getObjectName(), - sequenceNumber.getAndIncrement()); + Notification notification = + new Notification("j2ee.object.deleted", this.getObjectName(), sequenceNumber.getAndIncrement()); broadcaster.sendNotification(notification); } @@ -5470,8 +5470,8 @@ public class StandardContext extends ContainerBase implements Context, Notificat // If the pattern did not conflict, add the new constraint(s). if (!foundConflict) { - SecurityConstraint[] newSecurityConstraints = SecurityConstraint - .createConstraints(servletSecurityElement, urlPattern); + SecurityConstraint[] newSecurityConstraints = + SecurityConstraint.createConstraints(servletSecurityElement, urlPattern); for (SecurityConstraint securityConstraint : newSecurityConstraints) { addConstraint(securityConstraint); } @@ -5769,13 +5769,13 @@ public class StandardContext extends ContainerBase implements Context, Notificat @Override - public Map<String, String> findPostConstructMethods() { + public Map<String,String> findPostConstructMethods() { return postConstructMethods; } @Override - public Map<String, String> findPreDestroyMethods() { + public Map<String,String> findPreDestroyMethods() { return preDestroyMethods; } @@ -5962,8 +5962,8 @@ public class StandardContext extends ContainerBase implements Context, Notificat // Send j2ee.object.created notification if (this.getObjectName() != null) { - Notification notification = new Notification("j2ee.object.created", this.getObjectName(), - sequenceNumber.getAndIncrement()); + Notification notification = + new Notification("j2ee.object.created", this.getObjectName(), sequenceNumber.getAndIncrement()); broadcaster.sendNotification(notification); } } @@ -6311,7 +6311,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat } @Override - public Map<String, ? extends ServletRegistration> getServletRegistrations() { + public Map<String,? extends ServletRegistration> getServletRegistrations() { throw new UnsupportedOperationException(sm.getString("noPluggabilityServletContext.notAllowed")); } @@ -6342,7 +6342,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat } @Override - public Map<String, ? extends FilterRegistration> getFilterRegistrations() { + public Map<String,? extends FilterRegistration> getFilterRegistrations() { throw new UnsupportedOperationException(sm.getString("noPluggabilityServletContext.notAllowed")); } diff --git a/java/org/apache/catalina/core/StandardHost.java b/java/org/apache/catalina/core/StandardHost.java index ac9b8e13ab..6fb82eb46d 100644 --- a/java/org/apache/catalina/core/StandardHost.java +++ b/java/org/apache/catalina/core/StandardHost.java @@ -162,7 +162,7 @@ public class StandardHost extends ContainerBase implements Host { /** * Track the class loaders for the child web applications so memory leaks can be detected. */ - private final Map<ClassLoader, String> childClassLoaders = new WeakHashMap<>(); + private final Map<ClassLoader,String> childClassLoaders = new WeakHashMap<>(); /** @@ -694,7 +694,7 @@ public class StandardHost extends ContainerBase implements Host { List<String> result = new ArrayList<>(); - for (Map.Entry<ClassLoader, String> entry : childClassLoaders.entrySet()) { + for (Map.Entry<ClassLoader,String> entry : childClassLoaders.entrySet()) { ClassLoader cl = entry.getKey(); if (cl instanceof WebappClassLoaderBase) { if (!((WebappClassLoaderBase) cl).getState().isAvailable()) { diff --git a/java/org/apache/catalina/core/StandardWrapper.java b/java/org/apache/catalina/core/StandardWrapper.java index 9d4ba14e53..62fe8ad2f3 100644 --- a/java/org/apache/catalina/core/StandardWrapper.java +++ b/java/org/apache/catalina/core/StandardWrapper.java @@ -147,14 +147,14 @@ public class StandardWrapper extends ContainerBase implements ServletConfig, Wra /** * The initialization parameters for this servlet, keyed by parameter name. */ - protected HashMap<String, String> parameters = new HashMap<>(); + protected HashMap<String,String> parameters = new HashMap<>(); /** * The security role references for this servlet, keyed by role name used in the servlet. The corresponding value is * the role name of the web application itself. */ - protected HashMap<String, String> references = new HashMap<>(); + protected HashMap<String,String> references = new HashMap<>(); /** --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org