Skip to content

Commit 28d1127

Browse files
committed
Remove unnecessary test for availability of JSR-310 classes
We used to need this test when we supported Java 6 and 7, but it's no longer needed with Java 8 as the minimum. JAVA-4411
1 parent ea80e7e commit 28d1127

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

bson/src/main/org/bson/codecs/jsr310/Jsr310CodecProvider.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,10 @@
4141
public class Jsr310CodecProvider implements CodecProvider {
4242
private static final Map<Class<?>, Codec<?>> JSR310_CODEC_MAP = new HashMap<Class<?>, Codec<?>>();
4343
static {
44-
try {
45-
Class.forName("java.time.Instant"); // JSR-310 support canary test.
46-
putCodec(new InstantCodec());
47-
putCodec(new LocalDateCodec());
48-
putCodec(new LocalDateTimeCodec());
49-
putCodec(new LocalTimeCodec());
50-
} catch (ClassNotFoundException e) {
51-
// No JSR-310 support
52-
}
44+
putCodec(new InstantCodec());
45+
putCodec(new LocalDateCodec());
46+
putCodec(new LocalDateTimeCodec());
47+
putCodec(new LocalTimeCodec());
5348
}
5449

5550
private static void putCodec(final Codec<?> codec) {

0 commit comments

Comments
 (0)