tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core StandardContext.java
Date Thu, 14 Feb 2002 19:54:12 GMT
remm        02/02/14 11:54:12

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardContext.java
  Log:
  - Prevent a listener from being added twice.
  - Should fix bug 3770.
  
  Revision  Changes    Path
  1.95      +8 -5      jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java
  
  Index: StandardContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
  retrieving revision 1.94
  retrieving revision 1.95
  diff -u -r1.94 -r1.95
  --- StandardContext.java	11 Feb 2002 22:21:58 -0000	1.94
  +++ StandardContext.java	14 Feb 2002 19:54:12 -0000	1.95
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
1.94 2002/02/11 22:21:58 remm Exp $
  - * $Revision: 1.94 $
  - * $Date: 2002/02/11 22:21:58 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
1.95 2002/02/14 19:54:12 remm Exp $
  + * $Revision: 1.95 $
  + * $Date: 2002/02/14 19:54:12 $
    *
    * ====================================================================
    *
  @@ -145,7 +145,7 @@
    *
    * @author Craig R. McClanahan
    * @author Remy Maucherat
  - * @version $Revision: 1.94 $ $Date: 2002/02/11 22:21:58 $
  + * @version $Revision: 1.95 $ $Date: 2002/02/14 19:54:12 $
    */
   
   public class StandardContext
  @@ -1212,8 +1212,11 @@
   
           synchronized (applicationListeners) {
               String results[] =new String[applicationListeners.length + 1];
  -            for (int i = 0; i < applicationListeners.length; i++)
  +            for (int i = 0; i < applicationListeners.length; i++) {
  +                if (listener.equals(applicationListeners[i]))
  +                    return;
                   results[i] = applicationListeners[i];
  +            }
               results[applicationListeners.length] = listener;
               applicationListeners = results;
           }
  
  
  

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


Mime
View raw message