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

Edge case in virtual class field deserialization #1226

Open
AutonomicPerfectionist opened this issue Dec 23, 2022 · 0 comments · May be fixed by #1289
Open

Edge case in virtual class field deserialization #1226

AutonomicPerfectionist opened this issue Dec 23, 2022 · 0 comments · May be fixed by #1289

Comments

@AutonomicPerfectionist
Copy link
Contributor

Describe the bug
An edge case exists in the virtual class field deserialization routine,
where data intending to be deserialized as an array will instead be deserialized to
an ArrayList because there exists no type information to determine the representation
to use. For most cases, the method cache will be available to use for this type information,
but when using Service.sendBlocking() the callback method usually does not exist and therefore
no type information is available. An example use case where this would be a problem is when
calling a remote method using sendBlocking() that has an array return type.

Recommended Solution
The solution I recommend is adding a similar functionality as Service.blockingList to CodecUtils
that contains the type information for an expected message. The entries for this map will be set by Service.sendBlocking() just like the blockingList map. When CodecUtils.jsonToMessage() (from #1211) is called, it will check this map to see if the type information is available, and if so will pass it to the deserialization routines before removing it from the map (to avoid memory leaks, the type information shouldn't change otherwise). This will stop this edge case from being triggered by Service.sendBlocking() which is the only instance I know of.

@AutonomicPerfectionist AutonomicPerfectionist linked a pull request Jun 5, 2023 that will close this issue
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 a pull request may close this issue.

1 participant