vgritsenko    2002/09/05 19:49:08

  Modified:    src/java/org/apache/cocoon Tag: cocoon_2_0_3_branch
                        Cocoon.java
  Log:
  Fix bug #12139: Session can be modified while still
  being enumerated
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.22.2.3  +11 -8     xml-cocoon2/src/java/org/apache/cocoon/Cocoon.java
  
  Index: Cocoon.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/Cocoon.java,v
  retrieving revision 1.22.2.2
  retrieving revision 1.22.2.3
  diff -u -r1.22.2.2 -r1.22.2.3
  --- Cocoon.java       19 Jun 2002 13:48:33 -0000      1.22.2.2
  +++ Cocoon.java       6 Sep 2002 02:49:08 -0000       1.22.2.3
  @@ -537,13 +537,16 @@
   
           // log all of the session attributes
           if (session != null) {
  -             e = session.getAttributeNames();
  -
  -            while (e.hasMoreElements()) {
  -                String p = (String) e.nextElement();
  -
  -                msg.append("PARAM: '").append(p).append("' ")
  -                   .append("VALUE: 
'").append(session.getAttribute(p)).append("'").append(lineSeparator);
  +            // Fix bug #12139: Session can be modified while still
  +            // being enumerated here
  +            synchronized (session) {
  +                e = session.getAttributeNames();
  +                while (e.hasMoreElements()) {
  +                    String p = (String) e.nextElement();
  +                    msg.append("PARAM: '").append(p).append("' ")
  +                       .append("VALUE: 
'").append(session.getAttribute(p)).append("'")
  +                       .append(lineSeparator);
  +                }
               }
           }
   
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to