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;
}
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; }