title: Jackson's JsonSerializer and thread safety
body: <p>I have a simple <code>JsonSerializer</code> in my Spring project:</p>
  <pre><code>public class JsonDateTimeSerializer extends JsonSerializer&lt;Date&gt; {
      private static final DateFormat DATE_FORMAT = new SimpleDateFormat(&quot;yyyy-MM-dd HH:mm:ss&quot;);
  
      @Override
      public void serialize(Date value, JsonGenerator gen, SerializerProvider sp) throws IOException {
          gen.writeString(DATE_FORMAT.format(value));
      }
  }
  </code></pre>
  <p>And use it like:</p>
  <pre><code>@JsonSerialize(using = JsonDateTimeSerializer.class)
  public Date getDate() {
      return date;
  }
  </code></pre>
  <p>Do I have to take care of thread-safety and make the <code>DATE_FORMAT</code> synchronized (as <code>SimpleDateFormat</code> is not thread-safe)? I am not sure how exactly <code>@JsonSerialize</code> works - does it create just single serialized instance across all threads? Or does it create separate instance for each transformation?</p>