From c804d36ab2064d4503f73e6ffbcfee8f2d2519f0 Mon Sep 17 00:00:00 2001 From: kkolinko Date: Tue, 27 Apr 2010 09:01:37 +0000 Subject: [PATCH] If the class implements both interfaces then call addApplicationLifecycleListener only once. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@938363 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/catalina/core/ApplicationContext.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/java/org/apache/catalina/core/ApplicationContext.java b/java/org/apache/catalina/core/ApplicationContext.java index 4d7518d9f..5a86c4823 100644 --- a/java/org/apache/catalina/core/ApplicationContext.java +++ b/java/org/apache/catalina/core/ApplicationContext.java @@ -1266,13 +1266,9 @@ public class ApplicationContext match = true; } - if (t instanceof HttpSessionListener) { - context.addApplicationLifecycleListener(t); - match = true; - } - - if (t instanceof ServletContextListener) { - // TODO SERVLET3 - also need to check caller? spec isn't clear + if (t instanceof HttpSessionListener + || t instanceof ServletContextListener) { + // TODO SERVLET3 - if ServletContextListener then also need to check caller? spec isn't clear context.addApplicationLifecycleListener(t); match = true; } -- 2.11.0