RFR(m): JEP 269 initial API and skeleton implementation (JDK-8139232)
stuart.marks at oracle.com
Thu Nov 26 00:21:18 UTC 2015
On 11/25/15 8:25 AM, Paul Benedict wrote:
> Chris, you raise a good question. Example: JPA entities stored in an immutable
> list and the list belongs to a stateful EJB that gets passivated or clustered.
> Obviously, serialization would be occuring.
> On Wed, Nov 25, 2015 at 10:14 AM, Chris Hegarty <chris.hegarty at oracle.com
> <mailto:chris.hegarty at oracle.com>> wrote:
> Is there any impact on the Serializability of these collections, if
> they are “value” based? I don’t think so, but I’m not sure, since
> their serial form is not documented. Note to self: should we
> document their serial form?
For JDK 9, the plan is as follows. The current API specification requires the
collections be serializable. My plan is for the optimized implementations to use
a common serialization proxy class; that class is the only one that will have
its serial form documented. This preserves flexibility to change the optimized
The collections returned by the skeleton implementation are in fact
serializable, and this is tested by the regression tests. However, the
serialized form is not final. I've asked the JCK team to hold off developing
serialization tests until the serial proxy stuff gets in, at which time we can
commit to its documented serial form.
I don't know how serialization will work in the hypothetical value-typed future.
Using a serial proxy will, I hope, sidestep the issue of how a value type is
represented in the serialized object stream. Of course, this assumes that the
serialization mechanism, including proxying, continues to work similarly for
value types as it does for ordinary objects.
More information about the core-libs-dev