@@ -227,31 +227,33 @@ private boolean isConcreteClass(AnnotatedType type) {
227
227
*/
228
228
private List <BeanPropertyBiDefinition > introspectBeanProperties (JavaType javaType ) {
229
229
Map <String , BeanPropertyDefinition > forSerializationProps =
230
- springDocObjectMapper .jsonMapper ()
231
- .getSerializationConfig ()
232
- .introspect (javaType )
233
- .findProperties ()
234
- .stream ()
235
- .collect (toMap (BeanPropertyDefinition ::getName , identity ()));
230
+ springDocObjectMapper .jsonMapper ()
231
+ .getSerializationConfig ()
232
+ .introspect (javaType )
233
+ .findProperties ()
234
+ .stream ()
235
+ .collect (toMap (BeanPropertyDefinition ::getName , identity ()));
236
236
Map <String , BeanPropertyDefinition > forDeserializationProps =
237
- springDocObjectMapper .jsonMapper ()
238
- .getDeserializationConfig ()
239
- .introspect (javaType )
240
- .findProperties ()
241
- .stream ()
242
- .collect (toMap (BeanPropertyDefinition ::getName , identity ()));
237
+ springDocObjectMapper .jsonMapper ()
238
+ .getDeserializationConfig ()
239
+ .introspect (javaType )
240
+ .findProperties ()
241
+ .stream ()
242
+ .collect (toMap (BeanPropertyDefinition ::getName , identity ()));
243
243
244
244
return forSerializationProps .keySet ().stream ()
245
- .map (key -> new BeanPropertyBiDefinition (forSerializationProps .get (key ), forDeserializationProps .get (key )))
246
- .toList ();
245
+ .map (key -> new BeanPropertyBiDefinition (forSerializationProps .get (key ), forDeserializationProps .get (key )))
246
+ .toList ();
247
247
}
248
248
249
249
/**
250
250
* A record representing the bi-definition of a bean property, combining both
251
251
* serialization and deserialization property views.
252
252
*/
253
- private record BeanPropertyBiDefinition (BeanPropertyDefinition forSerialization ,
254
- BeanPropertyDefinition forDeserialization ) {
253
+ private record BeanPropertyBiDefinition (
254
+ BeanPropertyDefinition forSerialization ,
255
+ BeanPropertyDefinition forDeserialization
256
+ ) {
255
257
256
258
/**
257
259
* Retrieves an annotation of the specified type from either the serialization or
@@ -278,36 +280,36 @@ public <A extends Annotation> boolean isAnyAnnotated(Class<A> acls) {
278
280
public JavaType getPrimaryType () {
279
281
JavaType forSerializationType = null ;
280
282
if (forSerialization != null ) {
281
- forSerializationType = forSerialization .getPrimaryType ();
282
- }
283
+ forSerializationType = forSerialization .getPrimaryType ();
284
+ }
283
285
284
286
JavaType forDeserializationType = null ;
285
287
if (forDeserialization != null ) {
286
- forDeserializationType = forDeserialization .getPrimaryType ();
287
- }
288
+ forDeserializationType = forDeserialization .getPrimaryType ();
289
+ }
288
290
289
291
if (forSerializationType != null && forDeserializationType != null && forSerializationType != forDeserializationType ) {
290
292
throw new IllegalStateException ("The property " + forSerialization .getName () + " has different types for serialization and deserialization: "
291
- + forSerializationType + " and " + forDeserializationType );
293
+ + forSerializationType + " and " + forDeserializationType );
292
294
}
293
295
294
296
return forSerializationType != null ? forSerializationType : forDeserializationType ;
295
297
}
296
298
297
299
private <A extends Annotation > A getAnyAnnotation (BeanPropertyDefinition prop , Class <A > acls ) {
298
300
if (prop == null ) {
299
- return null ;
300
- }
301
+ return null ;
302
+ }
301
303
302
304
if (prop .getField () != null ) {
303
- return prop .getField ().getAnnotation (acls );
304
- }
305
+ return prop .getField ().getAnnotation (acls );
306
+ }
305
307
if (prop .getGetter () != null ) {
306
- return prop .getGetter ().getAnnotation (acls );
307
- }
308
+ return prop .getGetter ().getAnnotation (acls );
309
+ }
308
310
if (prop .getSetter () != null ) {
309
- return prop .getSetter ().getAnnotation (acls );
310
- }
311
+ return prop .getSetter ().getAnnotation (acls );
312
+ }
311
313
312
314
return null ;
313
315
}
0 commit comments