Browse Source

DATACMNS-1755 - Drop Java 8 check.

Remove explicit Java 8 check since it is now the minimum supported
version.

Original pull request: #448.
pull/451/head
Phillip Webb 6 years ago committed by Mark Paluch
parent
commit
df5f42ce29
No known key found for this signature in database
GPG Key ID: 51A00FA751B91849
  1. 12
      src/main/java/org/springframework/data/convert/Jsr310Converters.java

12
src/main/java/org/springframework/data/convert/Jsr310Converters.java

@ -30,7 +30,6 @@ import java.time.format.DateTimeFormatter; @@ -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; @@ -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; @@ -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 { @@ -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 { @@ -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);
}

Loading…
Cancel
Save