aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorBryce McKinlay <mckinlay@redhat.com>2004-08-03 00:21:26 +0000
committerBryce McKinlay <bryce@gcc.gnu.org>2004-08-03 01:21:26 +0100
commit474f541727096df25c2268c462fcb8c4daa898b6 (patch)
tree7fbb9888b13eb5c1dc0cdccd65293ade0df3fbe3 /libjava
parentfaebe6c2395d5f84c8333ab7398c61097281644c (diff)
downloadgcc-474f541727096df25c2268c462fcb8c4daa898b6.zip
gcc-474f541727096df25c2268c462fcb8c4daa898b6.tar.gz
gcc-474f541727096df25c2268c462fcb8c4daa898b6.tar.bz2
Timestamp.java (valueOf): Synchronize access to dateFormat.
2004-08-02 Bryce McKinlay <mckinlay@redhat.com> * java/sql/Timestamp.java (valueOf): Synchronize access to dateFormat. From-SVN: r85460
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog4
-rw-r--r--libjava/java/sql/Timestamp.java6
2 files changed, 9 insertions, 1 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 81922f2..52ac71c 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,5 +1,9 @@
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.
2004-08-01 Andrew John Hughes <gnu_andrew@member.fsf.org>
diff --git a/libjava/java/sql/Timestamp.java b/libjava/java/sql/Timestamp.java
index e480fff..b791ca1 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);