@@ -166,8 +166,8 @@ public static class MongoConverterConfigurationAdapter {
166
166
private boolean useNativeDriverJavaTimeCodecs = false ;
167
167
private final List <Object > customConverters = new ArrayList <>();
168
168
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 ;
171
171
172
172
/**
173
173
* Create a {@link MongoConverterConfigurationAdapter} using the provided {@code converters} and our own codecs for
@@ -188,7 +188,7 @@ public static MongoConverterConfigurationAdapter from(List<?> converters) {
188
188
}
189
189
190
190
/**
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
192
192
* {@link org.bson.codecs.jsr310.LocalDateCodec LocalDate}, {@link org.bson.codecs.jsr310.LocalTimeCodec LocalTime}
193
193
* and {@link org.bson.codecs.jsr310.LocalDateTimeCodec LocalDateTime} using a {@link ZoneOffset#UTC}.
194
194
*
@@ -328,16 +328,16 @@ public MongoConverterConfigurationAdapter setPropertyValueConversions(PropertyVa
328
328
PropertyValueConversions valueConversions () {
329
329
330
330
if (this .propertyValueConversions == null ) {
331
- this .propertyValueConversions = PropertyValueConversions . simple ( it -> {}) ;
331
+ this .propertyValueConversions = internalValueConversion ;
332
332
}
333
333
334
334
return this .propertyValueConversions ;
335
335
}
336
336
337
337
ConverterConfiguration createConverterConfiguration () {
338
338
339
- if ( isLocallyCreatedPropertyValueConversion () && propertyValueConversions instanceof SimplePropertyValueConversions svc ) {
340
- svc .init ();
339
+ if ( hasDefaultPropertyValueConversions () && propertyValueConversions instanceof SimplePropertyValueConversions ) {
340
+ (( SimplePropertyValueConversions ) propertyValueConversions ) .init ();
341
341
}
342
342
343
343
if (!useNativeDriverJavaTimeCodecs ) {
@@ -397,8 +397,8 @@ public LocalDate convert(Date source) {
397
397
}
398
398
}
399
399
400
- private boolean isLocallyCreatedPropertyValueConversion () {
401
- return propertyValueConversions == internallyCreatedValueConversion ;
400
+ private boolean hasDefaultPropertyValueConversions () {
401
+ return propertyValueConversions == internalValueConversion ;
402
402
}
403
403
}
404
404
}
0 commit comments