Skip to content

#589: Fix schema not including base class for records with subclasses #593

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

Draft
wants to merge 3 commits into
base: 2.19
Choose a base branch
from

Conversation

MichalFoksa
Copy link
Contributor

It is draft, do not review yet.

@MichalFoksa MichalFoksa force-pushed the feature/2.19/589-schema-does-not-include-base-class-for-records-with-subclasses branch from 952cbb7 to f43adf5 Compare May 14, 2025 15:57
@MichalFoksa MichalFoksa changed the title #589 Fix schema not including base class for records with subclasses #589: Fix schema not including base class for records with subclasses May 14, 2025
@MichalFoksa MichalFoksa force-pushed the feature/2.19/589-schema-does-not-include-base-class-for-records-with-subclasses branch from f43adf5 to ee0c73c Compare May 15, 2025 20:08
@cowtowncoder
Copy link
Member

Sounds good. Was about to suggest that due to RecordVisitor changes (addition of a Field) should go against 2.x not 2.19 but since it's private field maybe it can be considered internal (non-API) change.

@MichalFoksa MichalFoksa force-pushed the feature/2.19/589-schema-does-not-include-base-class-for-records-with-subclasses branch from ee0c73c to 99311ae Compare May 15, 2025 21:34
@MichalFoksa
Copy link
Contributor Author

I have problem to choose most obvious handling of duplicates in unionSchemas (inside if (subTypes != null && !subTypes.isEmpty()) condition).

  1. when I use HashSet then _typeSchema must be added into union last.

  2. when I use ArrayList, then I have to call unionSchemas .contains(subTypeSchema) before adding subTypeSchema into unionSchemas. However ArrayList.contains() is only object reference-equality check.

  3. If reference-equality check is enough for unionSchemas , then IdentityHashMap can be used to create a Set (Set<Schema> unionSchemas = Collections.newSetFromMap(new IdentityHashMap<>()) ) and we have simple code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants