>
> This will definitely not happen.  It will either: (a) serialize whatever
> non-transient fields you have, or (b) call read/writeObject to do *all*
> the serialization.  I'm not sure how it affects super/subclasses, but in
> this case the behavior is clear.  If you do read/writeObject, nothing
> will be serialized except the stuff you want serialized.
>
> --John Keiser

Okay:  let me clarify further.  I already use both loadFactor and threshold;
I'm fully aware of how they're used.  (And I agree with you about threshold
not needing to be serialized.)  However, in the "Serialized Form"
documentation for Hashtable (and this applies to HashMap, as well), a
writeObject() method is described which basically says:  write out the
capacity of the hashtable, write out its size, then write out its key/value
pairs.  *Then* it mentions threshold and loadFactor as "Serialized Fields",
but does not say how they fit into the serialized form of the hashtable.  It
doesn't say when, or even if, these fields are written out.  Now, of course,
loadFactor *has* to be part of the serialiazed form; but where does it fit
in?  Is this s spec bug (the threshold thing is certainly one), or am I
missing something basic about Java serialization?

-jaz

Reply via email to