@@ -130,10 +130,8 @@ public Document getMappedObject(Bson query, @Nullable MongoPersistentEntity<?> e
130
130
// TODO: remove one once QueryMapper can work with Query instances directly
131
131
if (Query .isRestrictedTypeKey (key )) {
132
132
133
- @ SuppressWarnings ("unchecked" )
134
133
Set <Class <?>> restrictedTypes = BsonUtils .get (query , key );
135
134
this .converter .getTypeMapper ().writeTypeRestrictions (result , restrictedTypes );
136
-
137
135
continue ;
138
136
}
139
137
@@ -271,7 +269,7 @@ protected Document getMappedKeyword(Keyword keyword, @Nullable MongoPersistentEn
271
269
if (keyword .isOrOrNor () || (keyword .hasIterableValue () && !keyword .isGeometry ())) {
272
270
273
271
Iterable <?> conditions = keyword .getValue ();
274
- List <Object > newConditions = new ArrayList <Object >();
272
+ List <Object > newConditions = new ArrayList <>();
275
273
276
274
for (Object condition : conditions ) {
277
275
newConditions .add (isDocument (condition ) ? getMappedObject ((Document ) condition , entity )
@@ -282,11 +280,12 @@ protected Document getMappedKeyword(Keyword keyword, @Nullable MongoPersistentEn
282
280
}
283
281
284
282
if (keyword .isSample ()) {
285
- return exampleMapper .getMappedExample (keyword .< Example <?>> getValue (), entity );
283
+ return exampleMapper .getMappedExample (keyword .getValue (), entity );
286
284
}
287
285
288
286
if (keyword .isJsonSchema ()) {
289
- return schemaMapper .mapSchema (new Document (keyword .getKey (), keyword .getValue ()), entity != null ? entity .getType () : Object .class );
287
+ return schemaMapper .mapSchema (new Document (keyword .getKey (), keyword .getValue ()),
288
+ entity != null ? entity .getType () : Object .class );
290
289
}
291
290
292
291
return new Document (keyword .getKey (), convertSimpleOrDocument (keyword .getValue (), entity ));
@@ -307,7 +306,7 @@ protected Document getMappedKeyword(Field property, Keyword keyword) {
307
306
Object convertedValue = needsAssociationConversion ? convertAssociation (value , property )
308
307
: getMappedValue (property .with (keyword .getKey ()), value );
309
308
310
- if (keyword .isSample () && convertedValue instanceof Document ) {
309
+ if (keyword .isSample () && convertedValue instanceof Document ) {
311
310
return (Document ) convertedValue ;
312
311
}
313
312
@@ -334,7 +333,7 @@ protected Object getMappedValue(Field documentField, Object value) {
334
333
335
334
if (valueDbo .containsField ("$in" ) || valueDbo .containsField ("$nin" )) {
336
335
String inKey = valueDbo .containsField ("$in" ) ? "$in" : "$nin" ;
337
- List <Object > ids = new ArrayList <Object >();
336
+ List <Object > ids = new ArrayList <>();
338
337
for (Object id : (Iterable <?>) valueDbo .get (inKey )) {
339
338
ids .add (convertId (id ));
340
339
}
@@ -353,7 +352,7 @@ else if (isDocument(value)) {
353
352
354
353
if (valueDbo .containsKey ("$in" ) || valueDbo .containsKey ("$nin" )) {
355
354
String inKey = valueDbo .containsKey ("$in" ) ? "$in" : "$nin" ;
356
- List <Object > ids = new ArrayList <Object >();
355
+ List <Object > ids = new ArrayList <>();
357
356
for (Object id : (Iterable <?>) valueDbo .get (inKey )) {
358
357
ids .add (convertId (id ));
359
358
}
@@ -426,8 +425,8 @@ protected boolean isAssociationConversionNecessary(Field documentField, @Nullabl
426
425
@ SuppressWarnings ("unchecked" )
427
426
protected Object convertSimpleOrDocument (Object source , @ Nullable MongoPersistentEntity <?> entity ) {
428
427
429
- if (source instanceof Example ) {
430
- return exampleMapper .getMappedExample ((Example )source , entity );
428
+ if (source instanceof Example ) {
429
+ return exampleMapper .getMappedExample ((Example ) source , entity );
431
430
}
432
431
433
432
if (source instanceof List ) {
0 commit comments