OPENJPA-2851 simplify comparison

since java.time classes are final we can also use == instead of isAssignableFrom
This commit is contained in:
Mark Struberg 2021-04-02 20:46:41 +02:00
parent 53cc83eb7e
commit 76225267d9
1 changed files with 5 additions and 5 deletions

View File

@ -1075,11 +1075,11 @@ public class Filters {
|| Time.class.isAssignableFrom(c) || Time.class.isAssignableFrom(c)
|| Timestamp.class.isAssignableFrom(c) || Timestamp.class.isAssignableFrom(c)
|| Calendar.class.isAssignableFrom(c) || Calendar.class.isAssignableFrom(c)
|| LocalDate.class.isAssignableFrom(c) || LocalDate.class == c // java.time classes are final, so we can compare with ==
|| LocalDateTime.class.isAssignableFrom(c) || LocalDateTime.class == c
|| LocalTime.class.isAssignableFrom(c) || LocalTime.class == c
|| OffsetTime.class.isAssignableFrom(c) || OffsetTime.class ==c
|| OffsetDateTime.class.isAssignableFrom(c)); || OffsetDateTime.class == c);
} }
public static Object getDefaultForNull(Class<?> nType) { public static Object getDefaultForNull(Class<?> nType) {