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

Define .putMslEncodable(MslEncodable, MslEncoderFactory, MslEncoderFormat) #157

Open
wmiaw opened this issue Mar 28, 2017 · 0 comments
Open
Assignees

Comments

@wmiaw
Copy link
Contributor

wmiaw commented Mar 28, 2017

At the moment, MslObject and MslArray accept MslEncodable instances but hold onto them as objects of their original concrete type. However this can create a problem because when someone tries to parse a MslObject or MslArray, they are expecting a MslEncodable to be parsed out and returned as a MslObject, not as an instance of the original concrete type.

The current code pushes this problem out to the caller which is why certain MslEncodable classes encode or encode+decode their MslObject or encoded byte[] representations before returning them. There are corresponding FIXME comments. The right solution, although it comes with higher computational overhead, is probably to add a .putMslEncodable() function that must be used for MslEncodables, and reject MslEncodable values from the .put() function.

@wmiaw wmiaw self-assigned this Mar 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant