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

Add serialization support (while still keeping backwards compatibility) #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aasaru
Copy link

@aasaru aasaru commented Mar 28, 2016

I propose adding serialization support to PDU-s. I have tested it and it worked fine.

User can still break serialization by adding non-serializable object to a PDU using setReferenceObject(). It would be possible to change the method signature for this method so it would take only a serializable parameter but this would break backwards compatibility so I just added a comment.

The other way would be to deprecate current method and add new method, something like this:
/**
* @deprecated Replaced by {@link #setReference(Object)}
*/
@deprecated
public void setReferenceObject(Object value) {
this.referenceObject = value;
}

public <T extends Serializable> void setReference(T value) {
    this.referenceObject = value;
}

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.

1 participant