Skip to content

Commit

Permalink
Fix #4077: remove unused "typeSer" argument
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Aug 20, 2023
1 parent 8a8b50d commit 45e6fa6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1306,20 +1306,21 @@ protected Object findFilterId(SerializationConfig config, BeanDescription beanDe
* (declared types) should be used for properties.
* (instead of dynamic runtime types).
*
* @since 2.1 (earlier had variant with additional 'property' parameter)
* @since 2.16 (earlier had variant with additional 'typeSer' parameter)
*/
protected boolean usesStaticTyping(SerializationConfig config,
BeanDescription beanDesc, TypeSerializer typeSer)
BeanDescription beanDesc)
{
// 16-Aug-2010, tatu: If there is a (value) type serializer, we cannot force
// static typing; that would make it impossible to handle expected subtypes
if (typeSer != null) {
return false;
}
AnnotationIntrospector intr = config.getAnnotationIntrospector();
JsonSerialize.Typing t = intr.findSerializationTyping(beanDesc.getClassInfo());
if (t != null && t != JsonSerialize.Typing.DEFAULT_TYPING) {
return (t == JsonSerialize.Typing.STATIC);
JsonSerialize.Typing t = config.getAnnotationIntrospector().findSerializationTyping(beanDesc.getClassInfo());
if (t != null) {
switch (t) {
case DYNAMIC:
return false;
case STATIC:
return true;
case DEFAULT_TYPING:
// fall through
}
}
return config.isEnabled(MapperFeature.USE_STATIC_TYPING);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ protected JsonSerializer<?> _createSerializer2(SerializerProvider prov,
// (note: called method checks for module-provided serializers)
if (type.isContainerType()) {
if (!staticTyping) {
staticTyping = usesStaticTyping(config, beanDesc, null);
staticTyping = usesStaticTyping(config, beanDesc);
}
// 03-Aug-2012, tatu: As per [databind#40], may require POJO serializer...
ser = buildContainerSerializer(prov, type, beanDesc, staticTyping);
Expand Down Expand Up @@ -612,7 +612,7 @@ protected List<BeanPropertyWriter> findBeanProperties(SerializerProvider prov,
return null;
}
// null is for value type serializer, which we don't have access to from here (ditto for bean prop)
boolean staticTyping = usesStaticTyping(config, beanDesc, null);
boolean staticTyping = usesStaticTyping(config, beanDesc);
PropertyBuilder pb = constructPropertyBuilder(config, beanDesc);

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

0 comments on commit 45e6fa6

Please sign in to comment.