From: Bryce McKinlay Date: Tue, 3 Aug 2004 00:21:26 +0000 (+0000) Subject: Timestamp.java (valueOf): Synchronize access to dateFormat. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=474f541727096df25c2268c462fcb8c4daa898b6;p=gcc.git Timestamp.java (valueOf): Synchronize access to dateFormat. 2004-08-02 Bryce McKinlay * java/sql/Timestamp.java (valueOf): Synchronize access to dateFormat. From-SVN: r85460 --- 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);