|
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:
|