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
This commit is contained in:
Bryce McKinlay 2004-08-03 00:21:26 +00:00 committed by Bryce McKinlay
parent faebe6c239
commit 474f541727
2 changed files with 9 additions and 1 deletions

View File

@ -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.

View File

@ -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);