RFR: 8336492: Regression in lambda serialization [v2]
Maurizio Cimadamore
mcimadamore at openjdk.org
Fri Jul 26 16:43:31 UTC 2024
On Fri, 26 Jul 2024 10:34:27 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Reduce incompatibilities by making sure that the name of a lambda captured parameter matches the name of the captured local (skipping any intermediate synthetic local capture in local classes)
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java line 2246:
>
>> 2244: return true;
>> 2245: }
>> 2246: if (sym.owner.kind != MTH && rs.isSerializable(sym.type)) {
>
> Note, this change serialized form for local/anon classes, by omitting capture of enclosing `this` where possible. (see discussion on serialization compatibility in the PR).
Note: consistency with the lambda case is kind of nice, but if this turns out to be problematic, we can omit this change from this PR, and always capture `this$0` in case of a serializable local/anon class.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20349#discussion_r1693336149
More information about the compiler-dev
mailing list