On Wed, 4 Mar 2026 16:58:50 GMT, Joe Darcy <[email protected]> wrote:

>> Vicente Romero has updated the pull request incrementally with two 
>> additional commits since the last revision:
>> 
>>  - Update src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java
>>    
>>    Co-authored-by: Chen Liang <[email protected]>
>>  - Update src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java
>>    
>>    Co-authored-by: Chen Liang <[email protected]>
>
> 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.

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

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

Reply via email to