diff --git a/src/main/java/org/springframework/data/convert/CustomConversions.java b/src/main/java/org/springframework/data/convert/CustomConversions.java index a52e0a249..427f01a69 100644 --- a/src/main/java/org/springframework/data/convert/CustomConversions.java +++ b/src/main/java/org/springframework/data/convert/CustomConversions.java @@ -214,11 +214,23 @@ public class CustomConversions { customSimpleTypes.add(pair.getSourceType()); if (LOG.isWarnEnabled() && !converterRegistration.isSimpleTargetType()) { - LOG.warn(String.format(WRITE_CONVERTER_NOT_SIMPLE, pair.getSourceType(), pair.getTargetType())); + + String msg = String.format(WRITE_CONVERTER_NOT_SIMPLE, pair.getSourceType(), pair.getTargetType()); + if (isJavaTimeType(pair.getTargetType())) { + + // TODO: this is a temporary fix seeking a better solution for 2.3 + LOG.debug(msg); + } else { + LOG.warn(msg); + } } } } + private boolean isJavaTimeType(Class type) { + return type.getName().startsWith("java.time"); + } + /** * Returns the target type to convert to in case we have a custom conversion registered to convert the given source * type into a Mongo native one.