ConcurrentHashMap serialization fix

Martin Buchholz martinrb at google.com
Fri Apr 26 12:00:23 PDT 2013


I've argued for years to assign someone to write cross-jdk serialization
tests, perhaps using the technique from:

./tools/javac/file/zip/8003512/LoadClassFromJava6CreatedJarTest.java:43: *
-javaoption:-Djava6.home="/path/to/jdk_or_jre6"



On Fri, Apr 26, 2013 at 6:58 AM, Chris Hegarty <chris.hegarty at oracle.com>wrote:

> Hi Doug, Peter,
>
> I did notice the change in serial form of CHMv8 when looking at another
> issue. While the addition of serialPersistentFields containing
> "segments" is welcome, there is still a change in serial form 7 to
> CHMv8. Both "int segmentMask" and "int segmentShift" are part of the 7
> serial form.
>
> We can either add them to the new serialPersistentFields in CHMv8, or
> request that they be removed from the serial form in JDK8.
>
> -Chris.
>
> On 25/04/2013 17:17, Doug Lea wrote:
> > On 04/25/13 10:47, Peter Levart wrote:
> >> Hello,
> >>
> >> The fix adds back "extends
> >> ReentrantLock" to CHM.Segment to fix the serialization format of new
> CHM.
> >
> > Thanks! I don't know how that went away.
> >
> >> The fix gets rid of CHM.segments field and uses serialPersistentFields
> >> array to simulate the field and changes the writeObject to use local
> >> instance of segments array for populating the stream.
> >
> > Even better. I'm always hesitant about creating serial fields,
> > but should have done it this way to begin with.
> >
> > I committed (with some trivial changes) to our jsr166 version,
> > so we can include when sync'ing up with main tl branch.
> >
> > -Doug
> >
> >
> >
>
>


More information about the lambda-dev mailing list