From: markt Date: Wed, 6 Oct 2010 21:47:27 +0000 (+0000) Subject: Fix comment typo X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=bc3a542063b0570fa7b429edc1ad3e8ada670ce7;p=tomcat7.0 Fix comment typo Better error message when a SCL can not be added since the listeners have already been called. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1005266 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/core/ApplicationContext.java b/java/org/apache/catalina/core/ApplicationContext.java index 391bad0f2..c216d49cc 100644 --- a/java/org/apache/catalina/core/ApplicationContext.java +++ b/java/org/apache/catalina/core/ApplicationContext.java @@ -206,7 +206,7 @@ public class ApplicationContext /** * Flag that indicates if a new {@link ServletContextListener} may be added * to the application. Once the first {@link ServletContextListener} is - * called, not more may be added. + * called, no more may be added. */ private boolean newServletContextListenerAllowed = true; @@ -1312,10 +1312,15 @@ public class ApplicationContext if (match) return; - throw new IllegalArgumentException(sm.getString( - "applicationContext.addListener.iae.wrongType", - t.getClass().getName())); - + if (t instanceof ServletContextListener) { + throw new IllegalArgumentException(sm.getString( + "applicationContext.addListener.iae.sclNotAllowed", + t.getClass().getName())); + } else { + throw new IllegalArgumentException(sm.getString( + "applicationContext.addListener.iae.wrongType", + t.getClass().getName())); + } }