DATACMNS-1755 - Drop Java 8 check.
Remove explicit Java 8 check since it is now the minimum supported version. Original pull request: #448.
This commit is contained in:
committed by
Mark Paluch
parent
ea263b233b
commit
df5f42ce29
@@ -30,7 +30,6 @@ import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -38,7 +37,6 @@ import javax.annotation.Nonnull;
|
||||
|
||||
import org.springframework.core.convert.converter.Converter;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
/**
|
||||
* Helper class to register JSR-310 specific {@link Converter} implementations in case the we're running on Java 8.
|
||||
@@ -51,8 +49,6 @@ import org.springframework.util.ClassUtils;
|
||||
*/
|
||||
public abstract class Jsr310Converters {
|
||||
|
||||
private static final boolean JAVA_8_IS_PRESENT = ClassUtils.isPresent("java.time.LocalDateTime",
|
||||
Jsr310Converters.class.getClassLoader());
|
||||
private static final List<Class<?>> CLASSES = Arrays.asList(LocalDateTime.class, LocalDate.class, LocalTime.class,
|
||||
Instant.class, ZoneId.class, Duration.class, Period.class);
|
||||
|
||||
@@ -63,10 +59,6 @@ public abstract class Jsr310Converters {
|
||||
*/
|
||||
public static Collection<Converter<?, ?>> getConvertersToRegister() {
|
||||
|
||||
if (!JAVA_8_IS_PRESENT) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
List<Converter<?, ?>> converters = new ArrayList<>();
|
||||
converters.add(DateToLocalDateTimeConverter.INSTANCE);
|
||||
converters.add(LocalDateTimeToDateConverter.INSTANCE);
|
||||
@@ -93,10 +85,6 @@ public abstract class Jsr310Converters {
|
||||
|
||||
public static boolean supports(Class<?> type) {
|
||||
|
||||
if (!JAVA_8_IS_PRESENT) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return CLASSES.contains(type);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user