incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r901577 - /sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestProgressTracker.java
Date Thu, 21 Jan 2010 07:18:56 GMT
Author: cziegeler
Date: Thu Jan 21 07:18:41 2010
New Revision: 901577

URL: http://svn.apache.org/viewvc?rev=901577&view=rev
Log:
SLING-1309 : Potential concurrent modification exception during request progress tracker dump

Modified:
    sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestProgressTracker.java

Modified: sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestProgressTracker.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestProgressTracker.java?rev=901577&r1=901576&r2=901577&view=diff
==============================================================================
--- sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestProgressTracker.java
(original)
+++ sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestProgressTracker.java
Thu Jan 21 07:18:41 2010
@@ -154,6 +154,9 @@
         entries.add(new TrackingEntry(COMMENT_PREFIX + "timer_end format is " + TIMER_END_FORMAT));
     }
 
+    /**
+     * @see org.apache.sling.api.request.RequestProgressTracker#getMessages()
+     */
     public Iterator<String> getMessages() {
         return new Iterator<String>() {
             private final Iterator<TrackingEntry> entryIter = entries.iterator();
@@ -181,14 +184,16 @@
      * Dumps the process timer entries to the given writer, one entry per line.
      * See the class comments for the rough format of each message line.
      */
-    public void dump(PrintWriter writer) {
+    public void dump(final PrintWriter writer) {
         logTimer(REQUEST_PROCESSING_TIMER,
             "Dumping SlingRequestProgressTracker Entries");
 
-        Iterator<String> messages = getMessages();
+        final StringBuilder sb = new StringBuilder();
+        final Iterator<String> messages = getMessages();
         while (messages.hasNext()) {
-            writer.print(messages.next());
+            sb.append(messages.next());
         }
+        writer.print(sb.toString());
     }
 
     /** Creates an entry with the given message. */



Mime
View raw message