@@ -132,10 +132,8 @@ public Document getMappedObject(Bson query, @Nullable MongoPersistentEntity<?> e
132
132
// TODO: remove one once QueryMapper can work with Query instances directly
133
133
if (Query .isRestrictedTypeKey (key )) {
134
134
135
- @ SuppressWarnings ("unchecked" )
136
135
Set <Class <?>> restrictedTypes = BsonUtils .get (query , key );
137
136
this .converter .getTypeMapper ().writeTypeRestrictions (result , restrictedTypes );
138
-
139
137
continue ;
140
138
}
141
139
@@ -282,7 +280,7 @@ protected Document getMappedKeyword(Keyword keyword, @Nullable MongoPersistentEn
282
280
if (keyword .isOrOrNor () || (keyword .hasIterableValue () && !keyword .isGeometry ())) {
283
281
284
282
Iterable <?> conditions = keyword .getValue ();
285
- List <Object > newConditions = new ArrayList <Object >();
283
+ List <Object > newConditions = new ArrayList <>();
286
284
287
285
for (Object condition : conditions ) {
288
286
newConditions .add (isDocument (condition ) ? getMappedObject ((Document ) condition , entity )
@@ -293,11 +291,12 @@ protected Document getMappedKeyword(Keyword keyword, @Nullable MongoPersistentEn
293
291
}
294
292
295
293
if (keyword .isSample ()) {
296
- return exampleMapper .getMappedExample (keyword .< Example <?>> getValue (), entity );
294
+ return exampleMapper .getMappedExample (keyword .getValue (), entity );
297
295
}
298
296
299
297
if (keyword .isJsonSchema ()) {
300
- return schemaMapper .mapSchema (new Document (keyword .getKey (), keyword .getValue ()), entity != null ? entity .getType () : Object .class );
298
+ return schemaMapper .mapSchema (new Document (keyword .getKey (), keyword .getValue ()),
299
+ entity != null ? entity .getType () : Object .class );
301
300
}
302
301
303
302
return new Document (keyword .getKey (), convertSimpleOrDocument (keyword .getValue (), entity ));
@@ -318,7 +317,7 @@ protected Document getMappedKeyword(Field property, Keyword keyword) {
318
317
Object convertedValue = needsAssociationConversion ? convertAssociation (value , property )
319
318
: getMappedValue (property .with (keyword .getKey ()), value );
320
319
321
- if (keyword .isSample () && convertedValue instanceof Document ) {
320
+ if (keyword .isSample () && convertedValue instanceof Document ) {
322
321
return (Document ) convertedValue ;
323
322
}
324
323
@@ -337,8 +336,8 @@ protected Document getMappedKeyword(Field property, Keyword keyword) {
337
336
@ SuppressWarnings ("unchecked" )
338
337
protected Object getMappedValue (Field documentField , Object value ) {
339
338
340
- if (documentField .getProperty () != null && documentField .getProperty ().hasExplicitWriteTarget ()) {
341
- if (conversionService .canConvert (value .getClass (), documentField .getProperty ().getFieldType ())) {
339
+ if (documentField .getProperty () != null && documentField .getProperty ().hasExplicitWriteTarget ()) {
340
+ if (conversionService .canConvert (value .getClass (), documentField .getProperty ().getFieldType ())) {
342
341
value = conversionService .convert (value , documentField .getProperty ().getFieldType ());
343
342
}
344
343
}
@@ -351,7 +350,7 @@ protected Object getMappedValue(Field documentField, Object value) {
351
350
352
351
if (valueDbo .containsField ("$in" ) || valueDbo .containsField ("$nin" )) {
353
352
String inKey = valueDbo .containsField ("$in" ) ? "$in" : "$nin" ;
354
- List <Object > ids = new ArrayList <Object >();
353
+ List <Object > ids = new ArrayList <>();
355
354
for (Object id : (Iterable <?>) valueDbo .get (inKey )) {
356
355
ids .add (convertId (id , getIdTypeForField (documentField )));
357
356
}
@@ -370,7 +369,7 @@ else if (isDocument(value)) {
370
369
371
370
if (valueDbo .containsKey ("$in" ) || valueDbo .containsKey ("$nin" )) {
372
371
String inKey = valueDbo .containsKey ("$in" ) ? "$in" : "$nin" ;
373
- List <Object > ids = new ArrayList <Object >();
372
+ List <Object > ids = new ArrayList <>();
374
373
for (Object id : (Iterable <?>) valueDbo .get (inKey )) {
375
374
ids .add (convertId (id , getIdTypeForField (documentField )));
376
375
}
@@ -451,8 +450,8 @@ protected boolean isAssociationConversionNecessary(Field documentField, @Nullabl
451
450
@ SuppressWarnings ("unchecked" )
452
451
protected Object convertSimpleOrDocument (Object source , @ Nullable MongoPersistentEntity <?> entity ) {
453
452
454
- if (source instanceof Example ) {
455
- return exampleMapper .getMappedExample ((Example )source , entity );
453
+ if (source instanceof Example ) {
454
+ return exampleMapper .getMappedExample ((Example ) source , entity );
456
455
}
457
456
458
457
if (source instanceof List ) {
0 commit comments