[11u]: RFR JDK-8227368: EnumSet.class serialization broken in JDK 9+

Stuart Marks stuart.marks at oracle.com
Wed Jul 17 22:48:37 UTC 2019



On 7/17/19 2:23 AM, Peter Levart wrote:
> It would be interesting to know what the api/serializabletypes JCK 11 test does. 
> Why does it fail when svuid field is introduced?

I'm not sure. The error is that it detects the added field with the value we 
provided. Clearly the class had to have been loaded and initialized for that to 
have occurred, so I suspect it uses reflection.

> Otherwise, your "sleazy hacks" to fabricate the correct (as of JDK 8) computed 
> svuid seem OK. The only gripe is that should any further changes to EnumSet be 
> necessary in JDK 11 u, they would have to be carefully constructed to not break 
> the serialization again. At least there is a test for that now :-)

Given that the changes in JDK 9 and 10 were mostly incidental, it seems unlikely 
that another change will be necessary in JDK 11u. But as you note there is a 
test now, so any changes will be caught quickly.

**

Process notes.

To move this along, I've followed the procedure at [1] (and also related pages 
beneath [2]) to request backport approval. This involved updating the main bug 
JDK-8227368 to add the jdk11u-fix-request and jdk12u-fix-request labels, and to 
add text justifying the backport, the reason for differences from the JDK 13 
fix, and linking to this review thread.

(I kind of doubt this will get put into JDK 12u, but the best way to find out is 
to ask, I think.)

Note that most process activity occurs around the main bug. (This isn't very 
well articulated in the process docs.) To this end, I've updated subject line of 
this message to use main bug, and in my patch I also use the main bug id.

(As an aside, it's usually not necessary to create a backport issue manually. 
When the fix is pushed, one will be created automatically, and the fix-version 
filled in. I've set the fix-version of the backport record JDK-8227650 to 11.0.5 
since I think that's the likely the right release value; but if an extra 
backport record gets created, no big, we can just close out the unused one. I'm 
not sure if this is actually explained anywhere. I did read several pages in the 
updates area of the wiki [2] and they don't say to create a backport issue, but 
they don't say not to either.)

Finally, as expected, the JDK 13 fix has been pulled forward into the jdk/jdk 
mainline.

s'marks

[1] http://openjdk.java.net/projects/jdk-updates/approval.html

[2] https://wiki.openjdk.java.net/display/JDKUpdates


More information about the jdk-updates-dev mailing list