Added note on non-thread-safety of Jackson's DateFormat support

master
Juergen Hoeller 12 years ago
parent 767bd3f3f8
commit 17610c2523
  1. 12
      spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperFactoryBean.java
  2. 6
      spring-web/src/main/java/org/springframework/http/converter/json/JacksonObjectMapperFactoryBean.java

@ -123,6 +123,8 @@ public class Jackson2ObjectMapperFactoryBean implements FactoryBean<ObjectMapper
/**
* Define the format for date/time with the given {@link DateFormat}.
* <p>Note: Setting this property makes the exposed {@link ObjectMapper}
* non-thread-safe, according to Jackson's thread safety rules.
* @see #setSimpleDateFormat(String)
*/
public void setDateFormat(DateFormat dateFormat) {
@ -131,6 +133,8 @@ public class Jackson2ObjectMapperFactoryBean implements FactoryBean<ObjectMapper
/**
* Define the date/time format with a {@link SimpleDateFormat}.
* <p>Note: Setting this property makes the exposed {@link ObjectMapper}
* non-thread-safe, according to Jackson's thread safety rules.
* @see #setDateFormat(DateFormat)
*/
public void setSimpleDateFormat(String format) {
@ -213,9 +217,11 @@ public class Jackson2ObjectMapperFactoryBean implements FactoryBean<ObjectMapper
/**
* Specify features to enable.
* @see MapperFeature
* @see SerializationFeature
* @see DeserializationFeature
* @see com.fasterxml.jackson.core.JsonParser.Feature
* @see com.fasterxml.jackson.core.JsonGenerator.Feature
* @see com.fasterxml.jackson.databind.SerializationFeature
* @see com.fasterxml.jackson.databind.DeserializationFeature
* @see com.fasterxml.jackson.databind.MapperFeature
*/
public void setFeaturesToEnable(Object... featuresToEnable) {
if (featuresToEnable != null) {

@ -106,6 +106,8 @@ public class JacksonObjectMapperFactoryBean implements FactoryBean<ObjectMapper>
/**
* Define the format for date/time with the given {@link DateFormat}.
* <p>Note: Setting this property makes the exposed {@link ObjectMapper}
* non-thread-safe, according to Jackson's thread safety rules.
* @see #setSimpleDateFormat(String)
*/
public void setDateFormat(DateFormat dateFormat) {
@ -114,6 +116,8 @@ public class JacksonObjectMapperFactoryBean implements FactoryBean<ObjectMapper>
/**
* Define the date/time format with a {@link SimpleDateFormat}.
* <p>Note: Setting this property makes the exposed {@link ObjectMapper}
* non-thread-safe, according to Jackson's thread safety rules.
* @see #setDateFormat(DateFormat)
*/
public void setSimpleDateFormat(String format) {
@ -134,8 +138,8 @@ public class JacksonObjectMapperFactoryBean implements FactoryBean<ObjectMapper>
* {@link org.codehaus.jackson.map.DeserializationConfig.Feature#AUTO_DETECT_FIELDS}.
*/
public void setAutoDetectFields(boolean autoDetectFields) {
this.features.put(DeserializationConfig.Feature.AUTO_DETECT_FIELDS, autoDetectFields);
this.features.put(SerializationConfig.Feature.AUTO_DETECT_FIELDS, autoDetectFields);
this.features.put(DeserializationConfig.Feature.AUTO_DETECT_FIELDS, autoDetectFields);
}
/**

Loading…
Cancel
Save