Skip to content

Commit 9c996cc

Browse files
committed
Polishing.
Reformat code. Remove superfluous warning suppressions. See #4687 Original pull request: #4695
1 parent c7800a6 commit 9c996cc

File tree

1 file changed

+2
-6
lines changed
  • spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert

1 file changed

+2
-6
lines changed

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

+2-6
Original file line numberDiff line numberDiff line change
@@ -580,19 +580,15 @@ protected boolean isAssociationConversionNecessary(Field documentField, @Nullabl
580580
* @return
581581
*/
582582
@Nullable
583-
@SuppressWarnings("unchecked")
584583
protected Object convertSimpleOrDocument(Object source, @Nullable MongoPersistentEntity<?> entity) {
585584

586585
if (source instanceof Example<?> example) {
587586
return exampleMapper.getMappedExample(example, entity);
588587
}
589588

590589
if (source instanceof AggregationExpression age) {
591-
592-
if(entity == null) {
593-
return age.toDocument();
594-
}
595-
return age.toDocument(new RelaxedTypeBasedAggregationOperationContext(entity.getType(), this.mappingContext, this));
590+
return entity == null ? age.toDocument() : //
591+
age.toDocument(new RelaxedTypeBasedAggregationOperationContext(entity.getType(), this.mappingContext, this));
596592
}
597593

598594
if (source instanceof MongoExpression exr) {

0 commit comments

Comments
 (0)