Skip to content
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

#774 Do not re-use serializers for CompatibleFieldSerializer and TaggedFieldSerializer #788

Merged
merged 3 commits into from
Nov 16, 2020

Conversation

theigl
Copy link
Collaborator

@theigl theigl commented Nov 2, 2020

Resolves #774
Resolves #784

This PR prevents re-using ReflectField serializers when using CompatibleFieldSerializer and TaggedFieldSerializer.

Re-using serializers works for FieldSerializer because it only provides a concrete valueClass for final field types or if fixedFieldTypes is enabled. CompatibleFieldSerializer and TaggedFieldSerializer always populate the valueClass with the last value they encounter.

I'm not fond of this solution but it is the only way to resolve this issue without breaking backwards compatibility.

@theigl theigl self-assigned this Nov 2, 2020
…le` and `Tagged` serializers in `ReflectField`
@theigl theigl force-pushed the #774-serializer-reuse branch 2 times, most recently from 4d1c422 to b5af092 Compare November 4, 2020 09:39
@theigl theigl changed the title #774 Do not re-use Compatible and Tagged serializers #774 Do not re-use serializers for CompatibleFieldSerializer and TaggedFieldSerializer Nov 4, 2020
@theigl theigl force-pushed the #774-serializer-reuse branch 6 times, most recently from 0580329 to 9a08a51 Compare November 6, 2020 13:05
@theigl
Copy link
Collaborator Author

theigl commented Nov 6, 2020

@magro: If you have a couple of minutes to spare, please take a look at this PR. This fix should make it into Kryo 5.0.1.

I asked Nate for feedback why we always set the valueClass for Compatible and Tagged serializers but I haven't heard from him yet. Removing the valueClass from those serializers would resolve this issue as well, but it would break serialization compatibility. So I guess this solution will have to do for now and we can revisit this for Kryo 6.

…le` and `Tagged` serializers in `ReflectField`
@theigl theigl merged commit 94103dd into EsotericSoftware:master Nov 16, 2020
@theigl theigl deleted the #774-serializer-reuse branch November 16, 2020 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant