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

Bug:Message Copy error #69

Open
oleotiger opened this issue May 27, 2018 · 1 comment
Open

Bug:Message Copy error #69

oleotiger opened this issue May 27, 2018 · 1 comment

Comments

@oleotiger
Copy link

oleotiger commented May 27, 2018

In Message.java , the function void copyFrom(Message m) copies propeties as
if (m.properties != null) { Set<String> keys = m.properties.keySet(); for (String key : keys) { updateProperty(key, m.getProperty(key)); } }
which add a reference to propeties of the original message instead of a clone of it when a property is such as List<Integer>.

@akeranen
Copy link
Owner

akeranen commented Jun 4, 2018

I thing you're right about that @oleotiger.

But what's the best way to fix this? I'm afraid extra .clone() won't cut it either; merely pushing the problem one step further (if at all, depending how well the method is implemented). Should we simply add warning to the documentation about shallow copies of properties?

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

No branches or pull requests

2 participants