Skip to content

Commit

Permalink
Remove deprecated constructor added via merged 2.x PR.
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Nov 21, 2023
1 parent fcc3858 commit 59d085e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,24 +169,6 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@
* Utilities to aid in the translation of decimal types to/from multiple parts.
*
* @author Nick Williams
* @since 2.2
*/
public final class DecimalUtils
{
private static final BigDecimal ONE_BILLION = new BigDecimal(1_000_000_000L);

private DecimalUtils() { }

public static String toDecimal(long seconds, int nanoseconds)
Expand Down Expand Up @@ -81,8 +78,6 @@ public static String toDecimal(long seconds, int nanoseconds)
/**
* Factory method for constructing {@link BigDecimal} out of second, nano-second
* components.
*
* @since 2.8
*/
public static BigDecimal toBigDecimal(long seconds, int nanoseconds)
{
Expand All @@ -97,24 +92,10 @@ public static BigDecimal toBigDecimal(long seconds, int nanoseconds)
return NumberInput.parseBigDecimal(toDecimal(seconds, nanoseconds));
}

/**
* @deprecated due to potential unbounded latency on some JRE releases.
*/
@Deprecated // since 2.9.8
public static int extractNanosecondDecimal(BigDecimal value, long integer)
{
// !!! 14-Mar-2016, tatu: Somewhat inefficient; should replace with functionally
// equivalent code that just subtracts integral part? (or, measure and show
// there's no difference and do nothing... )
return value.subtract(BigDecimal.valueOf(integer)).multiply(ONE_BILLION).intValue();
}

/**
* Extracts the seconds and nanoseconds component of {@code seconds} as {@code long} and {@code int}
* values, passing them to the given converter. The implementation avoids latency issues present
* on some JRE releases.
*
* @since 2.9.8
*/
public static <T> T extractSecondsAndNanos(BigDecimal seconds, BiFunction<Long, Integer, T> convert)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,10 @@ public void testToDecimal01()
"-22704862.599000000", decimal);
}

@SuppressWarnings("deprecation")
private void checkExtractNanos(long expectedSeconds, int expectedNanos, BigDecimal decimal)
{
long seconds = decimal.longValue();
assertEquals("The second part is not correct.", expectedSeconds, seconds);

int nanoseconds = DecimalUtils.extractNanosecondDecimal(decimal, seconds);
assertEquals("The nanosecond part is not correct.", expectedNanos, nanoseconds);
}

@Test
Expand Down

0 comments on commit 59d085e

Please sign in to comment.