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

remm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new eeb4e761ab Cleanup fixmes
eeb4e761ab is described below

commit eeb4e761abb1cbc2c0797dac558cd91fb3ef44ab
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 2ebe16c967..b01ee91382 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 e3d48e54eb..26a3e9c01d 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.
     }
@@ -103,7 +109,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);
@@ -120,7 +126,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 8704f4b5b4..a335cdcd34 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 1e74c6aa51..f9dd5b060a 100644
--- a/java/org/apache/catalina/core/StandardContext.java
+++ b/java/org/apache/catalina/core/StandardContext.java
@@ -5884,7 +5884,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 6f8b3919ce..e8964fb12b 100644
--- a/java/org/apache/catalina/core/StandardWrapper.java
+++ b/java/org/apache/catalina/core/StandardWrapper.java
@@ -1429,8 +1429,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 ed7bd471bc..63fb904594 100644
--- a/java/org/apache/catalina/mbeans/MBeanUtils.java
+++ b/java/org/apache/catalina/mbeans/MBeanUtils.java
@@ -457,29 +457,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 578b26d0d0..397058ea7c 100644
--- a/java/org/apache/catalina/session/StandardSession.java
+++ b/java/org/apache/catalina/session/StandardSession.java
@@ -731,7 +731,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 73f7c5649b..d99b98913a 100644
--- a/java/org/apache/catalina/startup/Bootstrap.java
+++ b/java/org/apache/catalina/startup/Bootstrap.java
@@ -421,9 +421,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 f70828d57c..0c054c7f2d 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

Reply via email to