Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

AbstractConnection throws NPE when used after deserialization #255

Open
viruzzo opened this issue Jun 11, 2018 · 0 comments
Open

AbstractConnection throws NPE when used after deserialization #255

viruzzo opened this issue Jun 11, 2018 · 0 comments

Comments

@viruzzo
Copy link

viruzzo commented Jun 11, 2018

In #121 Connection<A> has been made to extend Serializable, but (as noted in the comments) using any implementation of AbstractConnection<A> after deserialization fails with a NullPointerException
because it tries to use transient fields without restoring them.

Making the fields non-transient is difficult because of the larger number of classes that would need to be made serializable in turn; just restoring the fields on the other hand is not possible because there's a dependency on the API type and its parameters.

Currently the easiest path around the problem is to convert to a ConnectionData with createData(), but a correctly configured ConnectionFactoryLocator is then required to convert back to a Connection<A>.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant