Polishing.

Reformat code. Remove superfluous warning suppressions.

See #4687
Original pull request: #4695
This commit is contained in:
Mark Paluch
2024-05-14 15:22:31 +02:00
parent c7800a6549
commit 9c996ccf51

View File

@@ -580,7 +580,6 @@ public class QueryMapper {
* @return
*/
@Nullable
@SuppressWarnings("unchecked")
protected Object convertSimpleOrDocument(Object source, @Nullable MongoPersistentEntity<?> entity) {
if (source instanceof Example<?> example) {
@@ -588,11 +587,8 @@ public class QueryMapper {
}
if (source instanceof AggregationExpression age) {
if(entity == null) {
return age.toDocument();
}
return age.toDocument(new RelaxedTypeBasedAggregationOperationContext(entity.getType(), this.mappingContext, this));
return entity == null ? age.toDocument() : //
age.toDocument(new RelaxedTypeBasedAggregationOperationContext(entity.getType(), this.mappingContext, this));
}
if (source instanceof MongoExpression exr) {