RFR: 8140527: JInternalFrame has incorrect title button width [v4]

Alexey Ivanov aivanov at openjdk.org
Fri Jun 23 18:43:09 UTC 2023


On Fri, 23 Jun 2023 03:24:51 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>>> It can be removed in the strict sense but we need something to initialise it to so kept it as it is, as it will do no harm
>> 
>> Why does it need anything to initialise? The value is now set in either `if` or `else` branch.
>> 
>> It does not harm, yet it's never used. Not initialising it with `"InternalFrame.titleButtonWidth"` conveys it clearer: the value is computed later.
>
> ok. I thought buttonWidth was declared in the method but it is class variable

Nothing would've changed if it had been a local variable. Both branches initialise the local variable, the compiler is happy.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14555#discussion_r1240149559



More information about the client-libs-dev mailing list