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:01 GMT
remm        02/02/14 11:54:01

  Modified:    catalina/src/share/org/apache/catalina/core Tag:
                        tomcat_40_branch StandardContext.java
  Log:
  - Prevent a listener from being added twice.
  - Should fix bug 3770.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.78.2.11 +9 -6      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.78.2.10
  retrieving revision 1.78.2.11
  diff -u -r1.78.2.10 -r1.78.2.11
  --- StandardContext.java	7 Jan 2002 19:07:24 -0000	1.78.2.10
  +++ StandardContext.java	14 Feb 2002 19:54:00 -0000	1.78.2.11
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
1.78.2.10 2002/01/07 19:07:24 remm Exp $
  - * $Revision: 1.78.2.10 $
  - * $Date: 2002/01/07 19:07:24 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
1.78.2.11 2002/02/14 19:54:00 remm Exp $
  + * $Revision: 1.78.2.11 $
  + * $Date: 2002/02/14 19:54:00 $
    *
    * ====================================================================
    *
  @@ -142,7 +142,7 @@
    *
    * @author Craig R. McClanahan
    * @author Remy Maucherat
  - * @version $Revision: 1.78.2.10 $ $Date: 2002/01/07 19:07:24 $
  + * @version $Revision: 1.78.2.11 $ $Date: 2002/02/14 19:54:00 $
    */
   
   public class StandardContext
  @@ -1208,9 +1208,12 @@
       public void addApplicationListener(String listener) {
   
           synchronized (applicationListeners) {
  -            String results[] =new String[applicationListeners.length + 1];
  -            for (int i = 0; i < applicationListeners.length; i++)
  +            String results[] = new String[applicationListeners.length + 1];
  +            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