Skip to content

Commit

Permalink
Fix #286; add back InstantDeserializer constructor from 2.15, depreca…
Browse files Browse the repository at this point in the history
…ted (#290)
  • Loading branch information
cowtowncoder committed Nov 21, 2023
1 parent 9d93af4 commit cb18524
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
Expand Up @@ -153,6 +153,9 @@ public class InstantDeserializer<T extends Temporal>
*/
protected final boolean _alwaysAllowStringifiedDateTimestamps;

/**
* @since 2.16
*/
protected InstantDeserializer(Class<T> supportedType,
DateTimeFormatter formatter,
Function<TemporalAccessor, T> parsedToValue,
Expand All @@ -176,6 +179,24 @@ protected InstantDeserializer(Class<T> supportedType,
_alwaysAllowStringifiedDateTimestamps = readNumericStringsAsTimestamp;
}

/**
* @deprecated Since 2.16, use {@link #InstantDeserializer(Class,DateTimeFormatter,
* Function,Function,Function,BiFunction,boolean,boolean,boolean)} instead.
*/
@Deprecated()
protected InstantDeserializer(Class<T> supportedType,
DateTimeFormatter formatter,
Function<TemporalAccessor, T> parsedToValue,
Function<FromIntegerArguments, T> fromMilliseconds,
Function<FromDecimalArguments, T> fromNanoseconds,
BiFunction<T, ZoneId, T> adjust,
boolean replaceZeroOffsetAsZ
) {
this(supportedType, formatter, parsedToValue, fromMilliseconds, fromNanoseconds,
adjust, replaceZeroOffsetAsZ,
DEFAULT_NORMALIZE_ZONE_ID, DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS);
}

@SuppressWarnings("unchecked")
protected InstantDeserializer(InstantDeserializer<T> base, DateTimeFormatter f)
{
Expand Down
5 changes: 5 additions & 0 deletions release-notes/CREDITS-2.x
Expand Up @@ -185,3 +185,8 @@ M.P. Korstanje (mpkorstanje@github)
* Contributed #263: Add `JavaTimeFeature.ALWAYS_ALLOW_STRINGIFIED_TIMESTAMPS` to allow parsing
quoted numbers when using a custom DateTimeFormatter
(2.16.0)

Harald Kuhr (haraldk@github)
* Reported #286: Breaking change in `InstantDeserializer API between 2.15 and 2.16
(2.16.1)

2 changes: 2 additions & 0 deletions release-notes/VERSION-2.x
Expand Up @@ -10,6 +10,8 @@ Modules:

2.16.1 (not yet released)

#286: Breaking change in `InstantDeserializer API between 2.15 and 2.16
(reported by Harald K)
#288: `LocalDateTime` serialization issue with custom-configured
`LocalDateTimeSerializer`
(reported by @mklinkj)
Expand Down

0 comments on commit cb18524

Please sign in to comment.