You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2010/10/06 23:47:27 UTC

svn commit: r1005266 - /tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java

Author: markt
Date: Wed Oct  6 21:47:27 2010
New Revision: 1005266

URL: http://svn.apache.org/viewvc?rev=1005266&view=rev
Log:
Fix comment typo
Better error message when a SCL can not be added since the listeners have already been called.

Modified:
    tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java?rev=1005266&r1=1005265&r2=1005266&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java Wed Oct  6 21:47:27 2010
@@ -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()));
+        }
     }
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org