@@ -166,8 +166,8 @@ public static class MongoConverterConfigurationAdapter {
166166 private boolean useNativeDriverJavaTimeCodecs = false ;
167167 private final List <Object > customConverters = new ArrayList <>();
168168
169- private PropertyValueConversions propertyValueConversions = PropertyValueConversions .simple (it -> {});
170- private PropertyValueConversions internallyCreatedValueConversion = propertyValueConversions ;
169+ private final PropertyValueConversions internalValueConversion = PropertyValueConversions .simple (it -> {});
170+ private PropertyValueConversions propertyValueConversions = internalValueConversion ;
171171
172172 /**
173173 * Create a {@link MongoConverterConfigurationAdapter} using the provided {@code converters} and our own codecs for
@@ -188,7 +188,7 @@ public static MongoConverterConfigurationAdapter from(List<?> converters) {
188188 }
189189
190190 /**
191- * Set whether or not to use the native MongoDB Java Driver {@link org.bson.codecs.Codec codes} for
191+ * Set whether to or not to use the native MongoDB Java Driver {@link org.bson.codecs.Codec codes} for
192192 * {@link org.bson.codecs.jsr310.LocalDateCodec LocalDate}, {@link org.bson.codecs.jsr310.LocalTimeCodec LocalTime}
193193 * and {@link org.bson.codecs.jsr310.LocalDateTimeCodec LocalDateTime} using a {@link ZoneOffset#UTC}.
194194 *
@@ -328,16 +328,16 @@ public MongoConverterConfigurationAdapter setPropertyValueConversions(PropertyVa
328328 PropertyValueConversions valueConversions () {
329329
330330 if (this .propertyValueConversions == null ) {
331- this .propertyValueConversions = PropertyValueConversions . simple ( it -> {}) ;
331+ this .propertyValueConversions = internalValueConversion ;
332332 }
333333
334334 return this .propertyValueConversions ;
335335 }
336336
337337 ConverterConfiguration createConverterConfiguration () {
338338
339- if ( isLocallyCreatedPropertyValueConversion () && propertyValueConversions instanceof SimplePropertyValueConversions svc ) {
340- svc .init ();
339+ if ( hasDefaultPropertyValueConversions () && propertyValueConversions instanceof SimplePropertyValueConversions ) {
340+ (( SimplePropertyValueConversions ) propertyValueConversions ) .init ();
341341 }
342342
343343 if (!useNativeDriverJavaTimeCodecs ) {
@@ -397,8 +397,8 @@ public LocalDate convert(Date source) {
397397 }
398398 }
399399
400- private boolean isLocallyCreatedPropertyValueConversion () {
401- return propertyValueConversions == internallyCreatedValueConversion ;
400+ private boolean hasDefaultPropertyValueConversions () {
401+ return propertyValueConversions == internalValueConversion ;
402402 }
403403 }
404404}
0 commit comments