This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 00b54f45151a788ec095100629687e60c1dc2b8f Author: remm <r...@apache.org> AuthorDate: Tue Feb 20 14:08:58 2024 +0100 Cleanup fixmes --- .../apache/catalina/core/ApplicationContext.java | 2 -- .../catalina/core/ApplicationFilterFactory.java | 10 ++++++++-- .../apache/catalina/core/LocalStrings.properties | 2 ++ java/org/apache/catalina/core/StandardContext.java | 1 - java/org/apache/catalina/core/StandardWrapper.java | 2 -- java/org/apache/catalina/mbeans/MBeanFactory.java | 5 +---- java/org/apache/catalina/mbeans/MBeanUtils.java | 23 ---------------------- .../apache/catalina/session/StandardSession.java | 2 +- java/org/apache/catalina/startup/Bootstrap.java | 3 --- .../org/apache/catalina/startup/ContextConfig.java | 3 +-- .../apache/catalina/valves/JsonAccessLogValve.java | 2 -- java/org/apache/naming/NamingContext.java | 1 - 12 files changed, 13 insertions(+), 43 deletions(-) diff --git a/java/org/apache/catalina/core/ApplicationContext.java b/java/org/apache/catalina/core/ApplicationContext.java index d3841d45b2..bd8dceb6d3 100644 --- a/java/org/apache/catalina/core/ApplicationContext.java +++ b/java/org/apache/catalina/core/ApplicationContext.java @@ -624,7 +624,6 @@ public class ApplicationContext implements ServletContext { } catch (Throwable t) { ExceptionUtils.handleThrowable(t); context.fireContainerEvent("afterContextAttributeRemoved", listener); - // FIXME - should we do anything besides log these? log(sm.getString("applicationContext.attributeEvent"), t); } } @@ -687,7 +686,6 @@ public class ApplicationContext implements ServletContext { } else { context.fireContainerEvent("afterContextAttributeAdded", listener); } - // FIXME - should we do anything besides log these? log(sm.getString("applicationContext.attributeEvent"), t); } } diff --git a/java/org/apache/catalina/core/ApplicationFilterFactory.java b/java/org/apache/catalina/core/ApplicationFilterFactory.java index a40a5016c8..d71220de8e 100644 --- a/java/org/apache/catalina/core/ApplicationFilterFactory.java +++ b/java/org/apache/catalina/core/ApplicationFilterFactory.java @@ -23,7 +23,10 @@ import jakarta.servlet.ServletRequest; import org.apache.catalina.Globals; import org.apache.catalina.Wrapper; import org.apache.catalina.connector.Request; +import org.apache.juli.logging.Log; +import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.descriptor.web.FilterMap; +import org.apache.tomcat.util.res.StringManager; /** * Factory for the creation and caching of Filters and creation of Filter Chains. @@ -33,6 +36,9 @@ import org.apache.tomcat.util.descriptor.web.FilterMap; */ public final class ApplicationFilterFactory { + private static final Log log = LogFactory.getLog(ApplicationFilterFactory.class); + private static final StringManager sm = StringManager.getManager(ApplicationFilterFactory.class); + private ApplicationFilterFactory() { // Prevent instance creation. This is a utility class. } @@ -108,7 +114,7 @@ public final class ApplicationFilterFactory { ApplicationFilterConfig filterConfig = (ApplicationFilterConfig) context.findFilterConfig(filterMap.getFilterName()); if (filterConfig == null) { - // FIXME - log configuration problem + log.warn(sm.getString("applicationFilterFactory.noFilterConfig", filterMap.getFilterName())); continue; } filterChain.addFilter(filterConfig); @@ -125,7 +131,7 @@ public final class ApplicationFilterFactory { ApplicationFilterConfig filterConfig = (ApplicationFilterConfig) context.findFilterConfig(filterMap.getFilterName()); if (filterConfig == null) { - // FIXME - log configuration problem + log.warn(sm.getString("applicationFilterFactory.noFilterConfig", filterMap.getFilterName())); continue; } filterChain.addFilter(filterConfig); diff --git a/java/org/apache/catalina/core/LocalStrings.properties b/java/org/apache/catalina/core/LocalStrings.properties index a407310206..b4cdf612ec 100644 --- a/java/org/apache/catalina/core/LocalStrings.properties +++ b/java/org/apache/catalina/core/LocalStrings.properties @@ -55,6 +55,8 @@ applicationFilterConfig.jmxUnregisterFail=JMX de-registration failed for filter applicationFilterConfig.preDestroy=Failed the call to preDestroy for the filter named [{0}] of type [{1}] applicationFilterConfig.release=Failed to destroy the filter named [{0}] of type [{1}] +applicationFilterFactory.noFilterConfig=No filter configuration sound for [{0}] + applicationFilterRegistration.nullInitParam=Unable to set initialisation parameter for filter due to null name and/or value. Name [{0}], Value [{1}] applicationFilterRegistration.nullInitParams=Unable to set initialisation parameters for filter due to null name and/or value. Name [{0}], Value [{1}] diff --git a/java/org/apache/catalina/core/StandardContext.java b/java/org/apache/catalina/core/StandardContext.java index ae06417582..698dadf132 100644 --- a/java/org/apache/catalina/core/StandardContext.java +++ b/java/org/apache/catalina/core/StandardContext.java @@ -5920,7 +5920,6 @@ public class StandardContext extends ContainerBase implements Context, Notificat */ @Override public MBeanNotificationInfo[] getNotificationInfo() { - // FIXME: we not send j2ee.attribute.changed if (notificationInfo == null) { notificationInfo = new MBeanNotificationInfo[] { new MBeanNotificationInfo(new String[] { "j2ee.object.created" }, Notification.class.getName(), diff --git a/java/org/apache/catalina/core/StandardWrapper.java b/java/org/apache/catalina/core/StandardWrapper.java index 0b74d061de..43a53e1156 100644 --- a/java/org/apache/catalina/core/StandardWrapper.java +++ b/java/org/apache/catalina/core/StandardWrapper.java @@ -1468,8 +1468,6 @@ public class StandardWrapper extends ContainerBase implements ServletConfig, Wra */ @Override public MBeanNotificationInfo[] getNotificationInfo() { - // FIXME: we not send j2ee.state.failed - // FIXME: we not send j2ee.attribute.changed if (notificationInfo == null) { notificationInfo = new MBeanNotificationInfo[] { new MBeanNotificationInfo(new String[] { "j2ee.object.created" }, Notification.class.getName(), diff --git a/java/org/apache/catalina/mbeans/MBeanFactory.java b/java/org/apache/catalina/mbeans/MBeanFactory.java index 0990c3ece6..9763fe6464 100644 --- a/java/org/apache/catalina/mbeans/MBeanFactory.java +++ b/java/org/apache/catalina/mbeans/MBeanFactory.java @@ -623,10 +623,7 @@ public class MBeanFactory { if (container instanceof Context) { ((Context) container).setLoader(loader); } - // FIXME add Loader.getObjectName - // ObjectName oname = loader.getObjectName(); - ObjectName oname = MBeanUtils.createObjectName(pname.getDomain(), loader); - return oname.toString(); + return loader.getObjectName().toString(); } diff --git a/java/org/apache/catalina/mbeans/MBeanUtils.java b/java/org/apache/catalina/mbeans/MBeanUtils.java index 8914cb0b06..5097dad0ef 100644 --- a/java/org/apache/catalina/mbeans/MBeanUtils.java +++ b/java/org/apache/catalina/mbeans/MBeanUtils.java @@ -458,29 +458,6 @@ public class MBeanUtils { } - /** - * Create an <code>ObjectName</code> for this <code>Loader</code> object. - * - * @param domain Domain in which this name is to be created - * @param loader The Loader to be named - * - * @return a new object name - * - * @exception MalformedObjectNameException if a name cannot be created - */ - static ObjectName createObjectName(String domain, Loader loader) throws MalformedObjectNameException { - - ObjectName name = null; - Context context = loader.getContext(); - - ContextName cn = new ContextName(context.getName(), false); - Container host = context.getParent(); - name = new ObjectName(domain + ":type=Loader,host=" + host.getName() + ",context=" + cn.getDisplayName()); - - return name; - } - - /** * Create an <code>ObjectName</code> for this <code>Role</code> object. * diff --git a/java/org/apache/catalina/session/StandardSession.java b/java/org/apache/catalina/session/StandardSession.java index 6caa2acbc6..7e1141e39c 100644 --- a/java/org/apache/catalina/session/StandardSession.java +++ b/java/org/apache/catalina/session/StandardSession.java @@ -729,7 +729,7 @@ public class StandardSession implements HttpSession, Session, Serializable { expiring = true; // Notify interested application event listeners - // FIXME - Assumes we call listeners in reverse order + // Call listeners in reverse order Context context = manager.getContext(); // The call to expire() may not have been triggered by the webapp. diff --git a/java/org/apache/catalina/startup/Bootstrap.java b/java/org/apache/catalina/startup/Bootstrap.java index b31bdd1edf..0410db4e57 100644 --- a/java/org/apache/catalina/startup/Bootstrap.java +++ b/java/org/apache/catalina/startup/Bootstrap.java @@ -424,9 +424,6 @@ public final class Bootstrap { * Destroy the Catalina Daemon. */ public void destroy() { - - // FIXME - } diff --git a/java/org/apache/catalina/startup/ContextConfig.java b/java/org/apache/catalina/startup/ContextConfig.java index f605ccf40e..8b2e3de8c6 100644 --- a/java/org/apache/catalina/startup/ContextConfig.java +++ b/java/org/apache/catalina/startup/ContextConfig.java @@ -2544,8 +2544,7 @@ public class ContextConfig implements LifecycleListener { } /** - * process filter annotation and merge with existing one! FIXME: refactoring method too long and has redundant - * subroutines with processAnnotationWebServlet! + * Process filter annotation and merge with existing one * * @param className The filter class name * @param ae The filter annotation diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java b/java/org/apache/catalina/valves/JsonAccessLogValve.java index d69f43156c..61ca3d00da 100644 --- a/java/org/apache/catalina/valves/JsonAccessLogValve.java +++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java @@ -73,7 +73,6 @@ public class JsonAccessLogValve extends AccessLogValve { private static final Map<Character, String> PATTERNS; static { - // FIXME: finalize attribute names Map<Character, String> pattern2AttributeName = new HashMap<>(); pattern2AttributeName.put(Character.valueOf('a'), "remoteAddr"); pattern2AttributeName.put(Character.valueOf('A'), "localAddr"); @@ -102,7 +101,6 @@ public class JsonAccessLogValve extends AccessLogValve { private static final Map<Character, String> SUB_OBJECT_PATTERNS; static { - // FIXME: finalize attribute names Map<Character, String> pattern2AttributeName = new HashMap<>(); pattern2AttributeName.put(Character.valueOf('c'), "cookies"); pattern2AttributeName.put(Character.valueOf('i'), "requestHeaders"); diff --git a/java/org/apache/naming/NamingContext.java b/java/org/apache/naming/NamingContext.java index 8f4a3510c8..2cae5f14d7 100644 --- a/java/org/apache/naming/NamingContext.java +++ b/java/org/apache/naming/NamingContext.java @@ -791,7 +791,6 @@ public class NamingContext implements Context { throws NamingException { throw new OperationNotSupportedException (sm.getString("namingContext.noAbsoluteName")); - //FIXME ? } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org