Skip to content

Commit 45e6fa6

Browse files
committed
Fix #4077: remove unused "typeSer" argument
1 parent 8a8b50d commit 45e6fa6

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

src/main/java/com/fasterxml/jackson/databind/ser/BasicSerializerFactory.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,20 +1306,21 @@ protected Object findFilterId(SerializationConfig config, BeanDescription beanDe
13061306
* (declared types) should be used for properties.
13071307
* (instead of dynamic runtime types).
13081308
*
1309-
* @since 2.1 (earlier had variant with additional 'property' parameter)
1309+
* @since 2.16 (earlier had variant with additional 'typeSer' parameter)
13101310
*/
13111311
protected boolean usesStaticTyping(SerializationConfig config,
1312-
BeanDescription beanDesc, TypeSerializer typeSer)
1312+
BeanDescription beanDesc)
13131313
{
1314-
// 16-Aug-2010, tatu: If there is a (value) type serializer, we cannot force
1315-
// static typing; that would make it impossible to handle expected subtypes
1316-
if (typeSer != null) {
1317-
return false;
1318-
}
1319-
AnnotationIntrospector intr = config.getAnnotationIntrospector();
1320-
JsonSerialize.Typing t = intr.findSerializationTyping(beanDesc.getClassInfo());
1321-
if (t != null && t != JsonSerialize.Typing.DEFAULT_TYPING) {
1322-
return (t == JsonSerialize.Typing.STATIC);
1314+
JsonSerialize.Typing t = config.getAnnotationIntrospector().findSerializationTyping(beanDesc.getClassInfo());
1315+
if (t != null) {
1316+
switch (t) {
1317+
case DYNAMIC:
1318+
return false;
1319+
case STATIC:
1320+
return true;
1321+
case DEFAULT_TYPING:
1322+
// fall through
1323+
}
13231324
}
13241325
return config.isEnabled(MapperFeature.USE_STATIC_TYPING);
13251326
}

src/main/java/com/fasterxml/jackson/databind/ser/BeanSerializerFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ protected JsonSerializer<?> _createSerializer2(SerializerProvider prov,
199199
// (note: called method checks for module-provided serializers)
200200
if (type.isContainerType()) {
201201
if (!staticTyping) {
202-
staticTyping = usesStaticTyping(config, beanDesc, null);
202+
staticTyping = usesStaticTyping(config, beanDesc);
203203
}
204204
// 03-Aug-2012, tatu: As per [databind#40], may require POJO serializer...
205205
ser = buildContainerSerializer(prov, type, beanDesc, staticTyping);
@@ -612,7 +612,7 @@ protected List<BeanPropertyWriter> findBeanProperties(SerializerProvider prov,
612612
return null;
613613
}
614614
// null is for value type serializer, which we don't have access to from here (ditto for bean prop)
615-
boolean staticTyping = usesStaticTyping(config, beanDesc, null);
615+
boolean staticTyping = usesStaticTyping(config, beanDesc);
616616
PropertyBuilder pb = constructPropertyBuilder(config, beanDesc);
617617

618618
ArrayList<BeanPropertyWriter> result = new ArrayList<BeanPropertyWriter>(properties.size());

0 commit comments

Comments
 (0)