Title: Message Title
|
|
Issue Type:
|
Bug
|
Affects Versions:
|
13-RC1, 12.1
|
Assignee:
|
Unassigned
|
Components:
|
geojson
|
Created:
|
03/Mar/15 7:46 PM
|
Environment:
|
whatever
|
Priority:
|
Major
|
Reporter:
|
Guido Grazioli
|
|
The class org.geotools.geojson.GeoJSONUtil is using a shared static instance of SimpleDateFormat
public static SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
static {
DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("GMT"));
}
As documented in the class javadoc, use of it not thread-safe:
Synchronization - Date formats are not synchronized. It is recommended to create separate format instances for each thread. If multiple threads access a format concurrently, it must be synchronized externally.
Invocation of org.geotools.geojson.GeoJSONUtil.entry() in a multi-threaded environment causes the SimpleDateFormat to break with a ArrayOutOfBounds runtime exception, with a stakctrace like the following:
|
|
|
|
|
|
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel