From 474f541727096df25c2268c462fcb8c4daa898b6 Mon Sep 17 00:00:00 2001 From: Bryce McKinlay Date: Tue, 3 Aug 2004 00:21:26 +0000 Subject: [PATCH] Timestamp.java (valueOf): Synchronize access to dateFormat. 2004-08-02 Bryce McKinlay * java/sql/Timestamp.java (valueOf): Synchronize access to dateFormat. From-SVN: r85460 --- 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 81922f2655c..52ac71c667b 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,7 @@ +2004-08-02 Bryce McKinlay + + * java/sql/Timestamp.java (valueOf): Synchronize access to dateFormat. + 2004-08-02 Bryce McKinlay * testsuite/libjava.compile/PR16701.java: New test. diff --git a/libjava/java/sql/Timestamp.java b/libjava/java/sql/Timestamp.java index e480fff6be8..b791ca1e0f2 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); -- 2.30.2