final transient fields serialization
Pawel Veselov
pawel.veselov at gmail.com
Mon Nov 9 21:30:28 UTC 2009
Hi,
it again caught my attention, and I though that may be there is something
that can be done about this.
The issue is obvious -- having 'final transient' instance fields makes
little sense if the object is ever serialized.
Logically, there may be perfect reasoning behind making an instance field
final, as well as transient, in which case there is then no mechanism to
reinitialize this field on object deserialization.
It seems that it would be nice if either the final fields were initialized
in a separate block that would be executed on deserialization, or if
readObject() could set them. After all you can have a code block that sets
the final fields. Not sure how feasible that is, but IMHO, that is a short
coming.
--
With best of best regards
Pawel S. Veselov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/core-libs-dev/attachments/20091109/38e76bac/attachment.html>
More information about the core-libs-dev
mailing list