Browse Source

Polishing.

Reformat code.

See #3847
Original pull request: #3848.
pull/3856/head
Mark Paluch 4 years ago
parent
commit
c7263e5b11
No known key found for this signature in database
GPG Key ID: 4406B84C1661DCD1
  1. 4
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/DocumentPointerFactory.java

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

@ -91,7 +91,9 @@ class DocumentPointerFactory {
if (idProperty.hasExplicitWriteTarget() if (idProperty.hasExplicitWriteTarget()
&& conversionService.canConvert(idValue.getClass(), idProperty.getFieldType())) { && conversionService.canConvert(idValue.getClass(), idProperty.getFieldType())) {
return () -> conversionService.convert(idValue, idProperty.getFieldType()); return () -> conversionService.convert(idValue, idProperty.getFieldType());
} else if (idValue instanceof String && ObjectId.isValid((String)idValue)) { }
if (idValue instanceof String && ObjectId.isValid((String) idValue)) {
return () -> new ObjectId((String) idValue); return () -> new ObjectId((String) idValue);
} }

Loading…
Cancel
Save