Skip to content

Commit

Permalink
backport #423 in 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Mar 14, 2014
1 parent e6e15a5 commit 3a7a417
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Version: 2.3.3 (xx-xxx-2014)

#420: Remove 'final' modifier from `BeanDeserializerBase.deserializeWithType`
(requested by Ghoughpteighbteau@github)
#423: Fix `CalendarSerializer` to work with custom format
(repored by sergeymetallic@github)

------------------------------------------------------------------------
=== History: ===
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void serialize(Calendar value, JsonGenerator jgen, SerializerProvider pro
} else if (_customFormat != null) {
// 21-Feb-2011, tatu: not optimal, but better than alternatives:
synchronized (_customFormat) {
jgen.writeString(_customFormat.format(value));
jgen.writeString(_customFormat.format(value.getTime()));
}
} else {
provider.defaultSerializeDateValue(value.getTime(), jgen);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public void testDateWithJsonFormat() throws Exception

// and for [Issue#423] as well:
json = mapper.writer().with(getUTCTimeZone()).writeValueAsString(new CalendarAsStringBean(0L));
assertEquals("{\"date\":\"1970-01-01\"}", json);
assertEquals("{\"value\":\"1970-01-01\"}", json);
}

/**
Expand Down

0 comments on commit 3a7a417

Please sign in to comment.