Skip to content

Commit

Permalink
Added note on non-thread-safety of Jackson's DateFormat support
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed May 2, 2013
1 parent 767bd3f commit 17610c2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ public void setObjectMapper(ObjectMapper 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) {
Expand All @@ -131,6 +133,8 @@ public void setDateFormat(DateFormat dateFormat) {

/**
* 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) {
Expand Down Expand Up @@ -213,9 +217,11 @@ public void setIndentOutput(boolean indentOutput) {

/**
* 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ public void setObjectMapper(ObjectMapper 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) {
Expand All @@ -114,6 +116,8 @@ public void setDateFormat(DateFormat dateFormat) {

/**
* 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) {
Expand All @@ -134,8 +138,8 @@ public void setAnnotationIntrospector(AnnotationIntrospector annotationIntrospec
* {@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);
}

/**
Expand Down

0 comments on commit 17610c2

Please sign in to comment.