From: kkolinko Date: Tue, 27 Apr 2010 09:01:37 +0000 (+0000) Subject: If the class implements both interfaces then call addApplicationLifecycleListener... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c804d36ab2064d4503f73e6ffbcfee8f2d2519f0;p=tomcat7.0 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 --- 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; }