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

[closes #222] add API to encode/decode struct inside structs #223

Merged
merged 2 commits into from
Dec 8, 2016

Conversation

lorban
Copy link
Contributor

@lorban lorban commented Dec 8, 2016

Beware: this contains changes that might break the API of struct-decoding lambda helpers.

@lorban lorban self-assigned this Dec 8, 2016
@AbfrmBlr
Copy link
Contributor

AbfrmBlr commented Dec 8, 2016

StructArrayEncoder.string throws a null pointer for null values

@AbfrmBlr
Copy link
Contributor

AbfrmBlr commented Dec 8, 2016

java.lang.NullPointerException
at org.terracotta.runnel.encoding.dataholders.StringDataHolder.encodeString(StringDataHolder.java:48)
at org.terracotta.runnel.encoding.dataholders.StringDataHolder.(StringDataHolder.java:33)
at org.terracotta.runnel.encoding.StructArrayEncoder.string(StructArrayEncoder.java:106)
at org.ehcache.clustered.common.internal.messages.ExceptionCodec.encode(ExceptionCodec.java:65)

@lorban
Copy link
Contributor Author

lorban commented Dec 8, 2016

@AbfrmBlr : this works as designed: runnel does not encode null values so there are some checks preventing them. What you're supposed to do is add a null check yourself and only encode the string when you have a non-null value.

On the decoding side, runnel doesn't care if there was an encoded value or not: if you decode a field that wasn't encoded, you'll get null back.

But now that makes me wonder if runnel should allow encoding null values and simply ignore them, as well as using wrapper types instead of primitives, that might make the API nicer. Could you open a bug for this? I'll track it and do it if we deem it's worth it. Thanks!

@AbfrmBlr
Copy link
Contributor

AbfrmBlr commented Dec 8, 2016

I have filed an issue #226 and marked it as a question.

@AbfrmBlr AbfrmBlr merged commit e9bd3e4 into Terracotta-OSS:master Dec 8, 2016
@lorban lorban deleted the issue-222 branch December 9, 2016 08:09
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