On Wed, 4 Mar 2026 17:02:26 GMT, Chen Liang <[email protected]> wrote:

>> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java line 5058:
>> 
>>> 5056:             // fields
>>> 5057:             final Map<String, Symbol> declaredSerialMethodNames = new 
>>> HashMap<>();
>>> 5058:             final boolean[] isSerialMethodCorrect = new boolean[] { 
>>> false };
>> 
>> Why is a one-element boolean array being used as opposed to a (non-final) 
>> boolean?
>
> Because this is passed to a lambda expression, which requires final local 
> variables.

This variable is no longer used outside of `runUnderLint`, we can convert it to 
a local at the switch where it is assigned.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2187#discussion_r3032769231

Reply via email to