-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Support encoding/decoding of parameterized records #1005
Conversation
Initially I didn't consider the case where the type parameter was used directly as the type of one of the record components. I wonder if I'm missing anything else. Please try to think of other test cases. |
Unfortunately, this doesn't handle the case of a parameterized record with cyclical type references. For example, if you attempt to create codecs for this record"
where
you'll get a recursion resulting in a StackOverflowException:
and so on. To fix this we need to break the cycle somehow. But I think that can be the subject of another ticket and PR. This one adds value even if it doesn't handle cycles. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a regression test case for the resolving of types which move.
Add a ticket for the self referential example JAVA-4745
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit - location of the records.
Other than that LGTM
bson-record-codec/src/test/unit/org/bson/codecs/record/RecordCodecTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
JAVA-4740