directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r265766 - in /directory/asn1/trunk/der/src/java/org/apache/asn1/der: DERGeneralizedTime.java DERUTCTime.java
Date Thu, 01 Sep 2005 19:12:24 GMT
Author: elecharny
Date: Thu Sep  1 12:12:20 2005
New Revision: 265766

URL: http://svn.apache.org/viewcvs?rev=265766&view=rev
Log:
Synchronized the SimpleDateFormat

Modified:
    directory/asn1/trunk/der/src/java/org/apache/asn1/der/DERGeneralizedTime.java
    directory/asn1/trunk/der/src/java/org/apache/asn1/der/DERUTCTime.java

Modified: directory/asn1/trunk/der/src/java/org/apache/asn1/der/DERGeneralizedTime.java
URL: http://svn.apache.org/viewcvs/directory/asn1/trunk/der/src/java/org/apache/asn1/der/DERGeneralizedTime.java?rev=265766&r1=265765&r2=265766&view=diff
==============================================================================
--- directory/asn1/trunk/der/src/java/org/apache/asn1/der/DERGeneralizedTime.java (original)
+++ directory/asn1/trunk/der/src/java/org/apache/asn1/der/DERGeneralizedTime.java Thu Sep
 1 12:12:20 2005
@@ -48,7 +48,12 @@
      */
     public static DERGeneralizedTime valueOf( Date date )
     {
-        String dateString = dateFormat.format( date );
+        String dateString = null;
+        
+        synchronized (dateFormat)
+        {
+        	dateString = dateFormat.format( date );
+        }
         
         byte[] bytes = stringToByteArray( dateString );
 
@@ -65,7 +70,11 @@
     {
         String string = byteArrayToString( value );
         
-        return dateFormat.parse( string );
+        
+        synchronized (dateFormat)
+        {
+        	return dateFormat.parse( string );
+        }
     }
 }
 

Modified: directory/asn1/trunk/der/src/java/org/apache/asn1/der/DERUTCTime.java
URL: http://svn.apache.org/viewcvs/directory/asn1/trunk/der/src/java/org/apache/asn1/der/DERUTCTime.java?rev=265766&r1=265765&r2=265766&view=diff
==============================================================================
--- directory/asn1/trunk/der/src/java/org/apache/asn1/der/DERUTCTime.java (original)
+++ directory/asn1/trunk/der/src/java/org/apache/asn1/der/DERUTCTime.java Thu Sep  1 12:12:20
2005
@@ -48,7 +48,12 @@
      */
     public static DERUTCTime valueOf( Date date )
     {
-        String dateString = dateFormat.format( date );
+    	String dateString = null;
+    	
+        synchronized (dateFormat)
+        {
+        	dateString = dateFormat.format( date );
+        }
         
         byte[] bytes = stringToByteArray( dateString );
 
@@ -65,7 +70,10 @@
     {
         String string = byteArrayToString( value );
         
-        return dateFormat.parse( string );
+        synchronized (dateFormat)
+        {
+        	return dateFormat.parse( string );
+        }
     }
 }
 



Mime
View raw message