Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #286; add back InstantDeserializer constructor from 2.15, deprecated #290

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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