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

Copy should not ignore transient fields #83

Closed
ghost opened this issue Nov 11, 2013 · 7 comments
Closed

Copy should not ignore transient fields #83

ghost opened this issue Nov 11, 2013 · 7 comments

Comments

@ghost
Copy link

ghost commented Nov 11, 2013

From [email protected] on August 20, 2012 20:34:42

Copy should not ignore transient fields.

Original issue: http://code.google.com/p/kryo/issues/detail?id=83

@ghost
Copy link
Author

ghost commented Nov 11, 2013

From [email protected] on January 22, 2013 14:53:30

It could be an option to not ignore transient fields, but I think that it should be the default. People copy object graphs to avoid having to serialize/deserialize to get the same effect. If you performed the ser/deser operation the ignoring of transients would occur so it should be the default.

@romix
Copy link
Collaborator

romix commented Nov 12, 2013

Can we close this ancient issue?

The current status is:
Currently, transient fields are ignored during serialization, but taken into account when copying. This is controlled by a flag called "copyTransient" inside the FieldSerializer class. Currently this flag is final, because Nate was against making it configurable.

@ghost ghost assigned NathanSweet Nov 13, 2013
@magro
Copy link
Collaborator

magro commented Nov 13, 2013

Maybe we should make it possible to make copyTransient configurable (not final), as copying transient fields was just reported as issue #148?
@NathanSweet What do you think?

@NathanSweet
Copy link
Member

All major programming languages I looked at copy transient fields. Not
doing so is probably unexpected, but I guess if someone needs it then it
could be configurable.

On Wed, Nov 13, 2013 at 9:31 PM, Martin Grotzke [email protected]:

Maybe we should make it possible to make copyTransient configurable (not
final), as copying transient fields was just reported as issue #148#148
?
@NathanSweet https://github.com/NathanSweet What do you think?


Reply to this email directly or view it on GitHubhttps://github.com//issues/83#issuecomment-28431033
.

@romix
Copy link
Collaborator

romix commented Nov 13, 2013

Should I make it configurable via a FieldSerializer method then? Or do we also want to make it configurable at the Kryo instance level, so that all FieldSerializers automatically use the same setting?

@NathanSweet
Copy link
Member

I'd say at the FieldSerializer level is sufficient.

On Wed, Nov 13, 2013 at 10:15 PM, romix [email protected] wrote:

Should I make it configurable via a FieldSerializer method then? Or do we
also want to make it configurable at the Kryo instance level, so that all
FieldSerializers automatically use the same setting?


Reply to this email directly or view it on GitHubhttps://github.com//issues/83#issuecomment-28434454
.

romix added a commit that referenced this issue Nov 14, 2013
…lds by means of FieldSerializer.setCopyTransient. The default is set to copy transient field.
@romix
Copy link
Collaborator

romix commented Nov 14, 2013

OK. Add this functionality and a unit test for it.

@romix romix closed this as completed Nov 14, 2013
@NathanSweet
Copy link
Member

@romix A cool github trick is to use "closes #12345" in a commit message, which closes an issue or PR automatically. "#12345" references it without closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants