RFR: 8277965: Enclosing instance optimization affects serialization
Liam Miller-Cushon
cushon at openjdk.java.net
Wed Dec 1 21:33:27 UTC 2021
On Wed, 1 Dec 2021 20:47:16 GMT, Joe Darcy <darcy at openjdk.org> wrote:
>> This change disables the optimization introduced in [JDK-8271623](https://bugs.openjdk.java.net/browse/JDK-8277965) for all serializable classes, to avoid potential serialization compatibility issues.
>>
>> As discussed in [JDK-8277965](https://bugs.openjdk.java.net/browse/JDK-8277965) the serialization spec notes that serializing inner classes is 'strongly discouraged' and that the 'synthetic fields generated by javac ... to implement inner classes are implementation dependent and may vary between compilers', which may allow the new behaviour.
>>
>> This change is intended as an expedient way to restore the previous behaviour and provide more time to discuss the compatibility impact of this part of the change.
>
> Marked as reviewed by darcy (Reviewer).
@jddarcy thanks for the review!
To double-check before I integrate this, is anything still broken?
[JDK-8277718](https://bugs.openjdk.java.net/browse/JDK-8277718) mentions a decision to problem-list 3 JCK tests instead of backing this out, and in [JDK-8271717](https://bugs.openjdk.java.net/browse/JDK-8271717?focusedCommentId=14461616&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14461616) the issue with the JCK tests was described as a 'test bug'.
I'm happy back this out if, but I think it's worth considering keeping it (potentially after reverting it and having further discussion in a new CSR).
-------------
PR: https://git.openjdk.java.net/jdk/pull/6604
More information about the compiler-dev
mailing list