Skip to content

Commit c7263e5

Browse files
committed
Polishing.
Reformat code. See #3847 Original pull request: #3848.
1 parent eed9b24 commit c7263e5

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/DocumentPointerFactory.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,10 @@ DocumentPointer<?> computePointer(
9191
if (idProperty.hasExplicitWriteTarget()
9292
&& conversionService.canConvert(idValue.getClass(), idProperty.getFieldType())) {
9393
return () -> conversionService.convert(idValue, idProperty.getFieldType());
94-
} else if (idValue instanceof String && ObjectId.isValid((String)idValue)) {
95-
return () -> new ObjectId((String)idValue);
94+
}
95+
96+
if (idValue instanceof String && ObjectId.isValid((String) idValue)) {
97+
return () -> new ObjectId((String) idValue);
9698
}
9799

98100
return () -> idValue;
@@ -127,15 +129,15 @@ private boolean usesDefaultLookup(MongoPersistentProperty property) {
127129
/**
128130
* Value object that computes a document pointer from a given lookup query by identifying SpEL expressions and
129131
* inverting it.
130-
*
132+
*
131133
* <pre class="code">
132134
* // source
133135
* { 'firstname' : ?#{fn}, 'lastname' : '?#{ln} }
134-
*
136+
*
135137
* // target
136138
* { 'fn' : ..., 'ln' : ... }
137139
* </pre>
138-
*
140+
*
139141
* The actual pointer is the computed via
140142
* {@link #getDocumentPointer(MappingContext, MongoPersistentEntity, PersistentPropertyAccessor)} applying values from
141143
* the provided {@link PersistentPropertyAccessor} to the target document by looking at the keys of the expressions

0 commit comments

Comments
 (0)