Skip to content

Fix compilation issue wrt databind/5093 change #575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import tools.jackson.databind.BeanDescription;
import tools.jackson.databind.SerializationConfig;
import tools.jackson.databind.introspect.AnnotatedClass;
import tools.jackson.databind.ser.BeanPropertyWriter;
import tools.jackson.databind.ser.ValueSerializerModifier;

Expand All @@ -24,14 +23,13 @@ public class AvroSerializerModifier

@Override
public List<BeanPropertyWriter> changeProperties(SerializationConfig config,
BeanDescription beanDesc, List<BeanPropertyWriter> beanProperties)
BeanDescription.Supplier beanDescRef, List<BeanPropertyWriter> beanProperties)
{
AnnotatedClass ac = beanDesc.getClassInfo();
// Couple of ways to determine if it's generated class: main alternative
// would be to look for annotation `AvroGenerated` but check for base
// class seems simpler and as robust:

if (SpecificRecordBase.class.isAssignableFrom(ac.getRawType())) {
if (SpecificRecordBase.class.isAssignableFrom(beanDescRef.getBeanClass())) {
Iterator<BeanPropertyWriter> it = beanProperties.iterator();
while (it.hasNext()) {
BeanPropertyWriter prop = it.next();
Expand Down