@@ -30,18 +30,6 @@ public abstract class StdSerializer<T>
30
30
extends JsonSerializer <T >
31
31
implements JsonFormatVisitable , SchemaAware , java .io .Serializable
32
32
{
33
- /**
34
- * Unique key we use to store a temporary lock, to prevent infinite recursion
35
- * when resolving content converters (see [databind#357]).
36
- *<p>
37
- * NOTE: may need to revisit this if nested content converters are needed; if so,
38
- * may need to create per-call lock object. But let's start with a simpler
39
- * solution for now.
40
- *
41
- * @since 2.7
42
- */
43
- private final static Object CONVERTING_CONTENT_CONVERTER_LOCK = new Object ();
44
-
45
33
private static final long serialVersionUID = 1L ;
46
34
47
35
/**
@@ -363,28 +351,11 @@ protected JsonSerializer<?> findConvertingContentSerializer(SerializerProvider p
363
351
BeanProperty prop , JsonSerializer <?> existingSerializer )
364
352
throws JsonMappingException
365
353
{
366
- /* 19-Oct-2014, tatu: As per [databind#357], need to avoid infinite loop
367
- * when applying contextual content converter; this is not ideal way,
368
- * but should work for most cases.
369
- */
370
- Object ob = provider .getAttribute (CONVERTING_CONTENT_CONVERTER_LOCK );
371
- if (ob != null ) {
372
- if (ob == Boolean .TRUE ) { // just to ensure it's value we added.
373
- return existingSerializer ;
374
- }
375
- }
376
-
377
354
final AnnotationIntrospector intr = provider .getAnnotationIntrospector ();
378
355
if (intr != null && prop != null ) {
379
356
AnnotatedMember m = prop .getMember ();
380
357
if (m != null ) {
381
- provider .setAttribute (CONVERTING_CONTENT_CONVERTER_LOCK , Boolean .TRUE );
382
- Object convDef ;
383
- try {
384
- convDef = intr .findSerializationContentConverter (m );
385
- } finally {
386
- provider .setAttribute (CONVERTING_CONTENT_CONVERTER_LOCK , null );
387
- }
358
+ Object convDef = intr .findSerializationContentConverter (m );
388
359
if (convDef != null ) {
389
360
Converter <Object ,Object > conv = provider .converterInstance (prop .getMember (), convDef );
390
361
JavaType delegateType = conv .getOutputType (provider .getTypeFactory ());
0 commit comments