On Fri, 23 Jun 2023 03:24:51 GMT, Prasanta Sadhukhan <[email protected]> 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
