cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r643680 - /cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/WebContinuationDataBean.java
Date Wed, 02 Apr 2008 01:51:40 GMT
Author: joerg
Date: Tue Apr  1 18:51:34 2008
New Revision: 643680

URL: http://svn.apache.org/viewvc?rev=643680&view=rev
Log:
use thread-safe FastDateFormat instead of SimpleDateFormat

Modified:
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/WebContinuationDataBean.java

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/WebContinuationDataBean.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/WebContinuationDataBean.java?rev=643680&r1=643679&r2=643680&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/WebContinuationDataBean.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/WebContinuationDataBean.java
Tue Apr  1 18:51:34 2008
@@ -16,12 +16,14 @@
  */
 package org.apache.cocoon.components.flow;
 
-import java.text.SimpleDateFormat;
+import java.text.Format;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.commons.lang.time.FastDateFormat;
+
 /**
  * Access to continuation data for monitoring applications
  */
@@ -33,7 +35,7 @@
     private static final String HAS_EXPIRED_YES = "yes";
 
     private WebContinuation wc;
-    private SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
+    private Format formatter = FastDateFormat.getInstance("HH:mm:ss");
     private List _children = new ArrayList();
 
     public WebContinuationDataBean(WebContinuation wc) {
@@ -50,9 +52,7 @@
     }
 
     public String getLastAccessTime() {
-        synchronized (this.formatter) {
-            return formatter.format(new Date(wc.getLastAccessTime()));
-        }
+        return formatter.format(new Date(wc.getLastAccessTime()));
     }
 
     public String getInterpreterId() {
@@ -68,10 +68,7 @@
     }
 
     public String getExpireTime() {
-        Date date = new Date(wc.getLastAccessTime() + wc.getTimeToLive());
-        synchronized (this.formatter) {
-            return formatter.format(date);
-        }
+        return formatter.format(new Date(wc.getLastAccessTime() + wc.getTimeToLive()));
     }
 
     public String hasExpired() {



Mime
View raw message