From 00b0a4358855737dfd4c6f8e0de2a20dfef4338f Mon Sep 17 00:00:00 2001
From: bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 3 Aug 2004 00:21:26 +0000
Subject: [PATCH] 2004-08-02  Bryce McKinlay  <mckinlay@redhat.com>

	* java/sql/Timestamp.java (valueOf): Synchronize access to
	dateFormat.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85460 138bc75d-0d04-0410-961f-82ee72b054a4
---
 libjava/ChangeLog               | 4 ++++
 libjava/java/sql/Timestamp.java | 6 +++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 81922f2655cd..52ac71c667bc 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,7 @@
+2004-08-02  Bryce McKinlay  <mckinlay@redhat.com>
+
+	* java/sql/Timestamp.java (valueOf): Synchronize access to dateFormat.
+
 2004-08-02  Bryce McKinlay  <mckinlay@redhat.com>
 
 	* testsuite/libjava.compile/PR16701.java: New test.
diff --git a/libjava/java/sql/Timestamp.java b/libjava/java/sql/Timestamp.java
index e480fff6be88..b791ca1e0f2e 100644
--- a/libjava/java/sql/Timestamp.java
+++ b/libjava/java/sql/Timestamp.java
@@ -99,7 +99,11 @@ public class Timestamp extends java.util.Date
 
     try
       {
-	java.util.Date d = (java.util.Date) dateFormat.parseObject(str);
+        java.util.Date d;
+        synchronized (dateFormat)
+	  {
+	    d = (java.util.Date) dateFormat.parseObject(str);
+	  }
 
 	if (d == null)
 	  throw new IllegalArgumentException(str);
-- 
GitLab