Skip to content

Commit 414999a

Browse files
mp911deapp
authored and
app
committed
Polishing.
Reformat code. Remove superfluous warning suppressions. See spring-projects#4687 Original pull request: spring-projects#4695
1 parent 5d8ab4d commit 414999a

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
@@ -540,19 +540,15 @@ protected boolean isAssociationConversionNecessary(Field documentField, @Nullabl
540540
* @return
541541
*/
542542
@Nullable
543-
@SuppressWarnings("unchecked")
544543
protected Object convertSimpleOrDocument(Object source, @Nullable MongoPersistentEntity<?> entity) {
545544

546545
if (source instanceof Example<?> example) {
547546
return exampleMapper.getMappedExample(example, entity);
548547
}
549548

550549
if (source instanceof AggregationExpression age) {
551-
552-
if(entity == null) {
553-
return age.toDocument();
554-
}
555-
return age.toDocument(new RelaxedTypeBasedAggregationOperationContext(entity.getType(), this.mappingContext, this));
550+
return entity == null ? age.toDocument() : //
551+
age.toDocument(new RelaxedTypeBasedAggregationOperationContext(entity.getType(), this.mappingContext, this));
556552
}
557553

558554
if (source instanceof MongoExpression exr) {

0 commit comments

Comments
 (0)