RFR: 8336492: Regression in lambda serialization [v16]

ExE Boss duke at openjdk.org
Mon Aug 12 05:05:39 UTC 2024


On Fri, 9 Aug 2024 23:37:25 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> > Using `SequencedSet` would allow to skip the call to `com.sun.tools.javac.util.List​::reverse()` on the result of `CaptureScanner​::analyzeCaptures()`.
> 
> Not sure about that. Note that `Lower` wants the order of capture to be reversed compared to the "logical" order, but `LambdaToMethod` does not. To me, it is cleaner to put the reverse call close to the code that has "special" requirements, which in this case happens to be `Lower` (which is why the code ended up with that shape).

Well, at least typing the field as a `SequencedSet` would signal that the iteration order is important.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/20349#issuecomment-2283117689


More information about the compiler-dev mailing list