Skip to content

Commit

Permalink
Fix #1651
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jun 11, 2017
1 parent 247122f commit 3978538
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions release-notes/CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,8 @@ Slobodan Pejic (slobo-showbie@github)
Bertrand Renuart (brenuart@github)
* Reported #1648: `DateTimeSerializerBase` ignores configured date format when creating contextual
(2.8.9)
* Reported #1651: `StdDateFormat` fails to parse 'zulu' date when TimeZone other than UTC
(2.8.9)

Connor Kuhn (ckuhn@github)
* Contributed #1341: FAIL_ON_MISSING_EXTERNAL_TYPE_ID_PROPERTY
Expand Down
2 changes: 2 additions & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Project: jackson-databind
(reported by Slobodan P)
#1648: `DateTimeSerializerBase` ignores configured date format when creating contextual
(reported by Bertrand R)
#1651: `StdDateFormat` fails to parse 'zulu' date when TimeZone other than UTC
(reported by Bertrand R)

2.8.8.1 (19-Apr-2017)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,11 @@ protected Date parseAsISO8601(String dateStr, ParsePosition pos, boolean throwEr
df = _formatISO8601_z;
formatStr = DATE_FORMAT_STR_ISO8601_Z;
if (df == null) {
// 10-Jun-2017, tatu: As per [databind#1651], when using this format,
// must use UTC, not whatever is configured as default timezone
// (because we know `Z` identifier is used)
df = _formatISO8601_z = _cloneFormat(DATE_FORMAT_ISO8601_Z, formatStr,
_timezone, _locale, _lenient);
DEFAULT_TIMEZONE, _locale, _lenient);
}
// may be missing milliseconds... if so, add
if (dateStr.charAt(len-4) == ':') {
Expand Down Expand Up @@ -520,8 +523,11 @@ protected Date parseAsISO8601(String dateStr, ParsePosition pos, boolean throwEr
df = _formatISO8601_z;
formatStr = DATE_FORMAT_STR_ISO8601_Z;
if (df == null) {
// 10-Jun-2017, tatu: As per [databind#1651], when using this format,
// must use UTC, not whatever is configured as default timezone
// (because we know `Z` identifier is used)
df = _formatISO8601_z = _cloneFormat(DATE_FORMAT_ISO8601_Z, formatStr,
_timezone, _locale, _lenient);
DEFAULT_TIMEZONE, _locale, _lenient);
}
}
}
Expand Down

0 comments on commit 3978538

Please sign in to comment.