@@ -156,8 +156,8 @@ public static class MongoConverterConfigurationAdapter {
156
156
private boolean useNativeDriverJavaTimeCodecs = false ;
157
157
private final List <Object > customConverters = new ArrayList <>();
158
158
159
- private PropertyValueConversions propertyValueConversions = PropertyValueConversions .simple (it -> {});
160
- private PropertyValueConversions internallyCreatedValueConversion = propertyValueConversions ;
159
+ private final PropertyValueConversions internalValueConversion = PropertyValueConversions .simple (it -> {});
160
+ private PropertyValueConversions propertyValueConversions = internalValueConversion ;
161
161
162
162
/**
163
163
* Create a {@link MongoConverterConfigurationAdapter} using the provided {@code converters} and our own codecs for
@@ -178,7 +178,7 @@ public static MongoConverterConfigurationAdapter from(List<?> converters) {
178
178
}
179
179
180
180
/**
181
- * Set whether or not to use the native MongoDB Java Driver {@link org.bson.codecs.Codec codes} for
181
+ * Set whether to or not to use the native MongoDB Java Driver {@link org.bson.codecs.Codec codes} for
182
182
* {@link org.bson.codecs.jsr310.LocalDateCodec LocalDate}, {@link org.bson.codecs.jsr310.LocalTimeCodec LocalTime}
183
183
* and {@link org.bson.codecs.jsr310.LocalDateTimeCodec LocalDateTime} using a {@link ZoneOffset#UTC}.
184
184
*
@@ -318,15 +318,16 @@ public MongoConverterConfigurationAdapter setPropertyValueConversions(PropertyVa
318
318
PropertyValueConversions valueConversions () {
319
319
320
320
if (this .propertyValueConversions == null ) {
321
- this .propertyValueConversions = PropertyValueConversions . simple ( it -> {}) ;
321
+ this .propertyValueConversions = internalValueConversion ;
322
322
}
323
323
324
324
return this .propertyValueConversions ;
325
325
}
326
326
327
327
ConverterConfiguration createConverterConfiguration () {
328
328
329
- if (isLocallyCreatedPropertyValueConversion () && propertyValueConversions instanceof SimplePropertyValueConversions svc ) {
329
+ if (hasDefaultPropertyValueConversions ()
330
+ && propertyValueConversions instanceof SimplePropertyValueConversions svc ) {
330
331
svc .init ();
331
332
}
332
333
@@ -387,8 +388,8 @@ public LocalDate convert(Date source) {
387
388
}
388
389
}
389
390
390
- private boolean isLocallyCreatedPropertyValueConversion () {
391
- return propertyValueConversions == internallyCreatedValueConversion ;
391
+ private boolean hasDefaultPropertyValueConversions () {
392
+ return propertyValueConversions == internalValueConversion ;
392
393
}
393
394
}
394
395
}
0 commit comments