@@ -171,8 +171,8 @@ protected ConversionContext getConversionContext(ObjectPath path) {
171
171
172
172
Assert .notNull (path , "ObjectPath must not be null" );
173
173
174
- return new ConversionContext (conversions , path , this ::readDocument , this ::readCollectionOrArray , this ::readMap , this :: readDBRef ,
175
- this ::getPotentiallyConvertedSimpleRead );
174
+ return new ConversionContext (conversions , path , this ::readDocument , this ::readCollectionOrArray , this ::readMap ,
175
+ this ::readDBRef , this :: getPotentiallyConvertedSimpleRead );
176
176
}
177
177
178
178
/**
@@ -527,7 +527,8 @@ private void readAssociation(Association<MongoPersistentProperty> association, P
527
527
return ;
528
528
}
529
529
530
- if (property .isDocumentReference () || (!property .isDbReference () && property .findAnnotation (Reference .class ) != null )) {
530
+ if (property .isDocumentReference ()
531
+ || (!property .isDbReference () && property .findAnnotation (Reference .class ) != null )) {
531
532
532
533
// quite unusual but sounds like worth having?
533
534
@@ -595,13 +596,13 @@ public DocumentPointer toDocumentPointer(Object source, @Nullable MongoPersisten
595
596
596
597
Assert .notNull (referringProperty , "Cannot create DocumentReference. The referringProperty must not be null!" );
597
598
598
- if (referringProperty .isDbReference ()) {
599
- return () -> toDBRef (source , referringProperty );
600
- }
599
+ if (referringProperty .isDbReference ()) {
600
+ return () -> toDBRef (source , referringProperty );
601
+ }
601
602
602
- if (referringProperty .isDocumentReference () || referringProperty .findAnnotation (Reference .class ) != null ) {
603
- return createDocumentPointer (source , referringProperty );
604
- }
603
+ if (referringProperty .isDocumentReference () || referringProperty .findAnnotation (Reference .class ) != null ) {
604
+ return createDocumentPointer (source , referringProperty );
605
+ }
605
606
606
607
throw new IllegalArgumentException ("The referringProperty is neither a DBRef nor a document reference" );
607
608
}
@@ -612,7 +613,7 @@ DocumentPointer<?> createDocumentPointer(Object source, @Nullable MongoPersisten
612
613
return () -> source ;
613
614
}
614
615
615
- if (source instanceof DocumentPointer ) {
616
+ if (source instanceof DocumentPointer ) {
616
617
return (DocumentPointer <?>) source ;
617
618
}
618
619
@@ -622,7 +623,8 @@ DocumentPointer<?> createDocumentPointer(Object source, @Nullable MongoPersisten
622
623
}
623
624
624
625
if (ClassUtils .isAssignableValue (referringProperty .getAssociationTargetType (), source )) {
625
- return documentPointerFactory .computePointer (mappingContext , referringProperty , source , referringProperty .getActualType ());
626
+ return documentPointerFactory .computePointer (mappingContext , referringProperty , source ,
627
+ referringProperty .getActualType ());
626
628
}
627
629
628
630
return () -> source ;
@@ -1978,9 +1980,10 @@ protected static class ConversionContext {
1978
1980
private final ContainerValueConverter <DBRef > dbRefConverter ;
1979
1981
private final ValueConverter <Object > elementConverter ;
1980
1982
1981
- ConversionContext (org .springframework .data .convert .CustomConversions customConversions , ObjectPath path , ContainerValueConverter <Bson > documentConverter ,
1982
- ContainerValueConverter <Collection <?>> collectionConverter , ContainerValueConverter <Bson > mapConverter ,
1983
- ContainerValueConverter <DBRef > dbRefConverter , ValueConverter <Object > elementConverter ) {
1983
+ ConversionContext (org .springframework .data .convert .CustomConversions customConversions , ObjectPath path ,
1984
+ ContainerValueConverter <Bson > documentConverter , ContainerValueConverter <Collection <?>> collectionConverter ,
1985
+ ContainerValueConverter <Bson > mapConverter , ContainerValueConverter <DBRef > dbRefConverter ,
1986
+ ValueConverter <Object > elementConverter ) {
1984
1987
1985
1988
this .conversions = customConversions ;
1986
1989
this .path = path ;
@@ -2052,8 +2055,8 @@ public ConversionContext withPath(ObjectPath currentPath) {
2052
2055
2053
2056
Assert .notNull (currentPath , "ObjectPath must not be null" );
2054
2057
2055
- return new ConversionContext (conversions , currentPath , documentConverter , collectionConverter , mapConverter , dbRefConverter ,
2056
- elementConverter );
2058
+ return new ConversionContext (conversions , currentPath , documentConverter , collectionConverter , mapConverter ,
2059
+ dbRefConverter , elementConverter );
2057
2060
}
2058
2061
2059
2062
public ObjectPath getPath () {
0 commit comments