diff --git a/core/src/main/java/dev/morphia/mapping/codec/Conversions.java b/core/src/main/java/dev/morphia/mapping/codec/Conversions.java index a63fc10a3f5..4aa781e666e 100644 --- a/core/src/main/java/dev/morphia/mapping/codec/Conversions.java +++ b/core/src/main/java/dev/morphia/mapping/codec/Conversions.java @@ -96,9 +96,7 @@ private static void registerStringConversions() { throw new MappingException("Could not convert String to char: " + s); } }); - register(Class.class, String.class, aClass -> { - return aClass.getName(); - }); + register(Class.class, String.class, Class::getName); register(String.class, Class.class, className -> { try { return Thread.currentThread().getContextClassLoader().loadClass(className);