RFR: 8342870: Errors related to unused code on Windows after 8339120 in accessibility [v5]

Alexey Ivanov aivanov at openjdk.org
Fri Jan 24 20:38:56 UTC 2025


On Thu, 23 Jan 2025 05:50:29 GMT, Julian Waters <jwaters at openjdk.org> wrote:

>> src/jdk.accessibility/windows/native/jaccesswalker/jaccesswalker.cpp line 261:
>> 
>>> 259:         GetClientRect(hWnd, &rcClient);
>>> 260:      // hwndEdit =
>>> 261:                    CreateWindow("Edit",
>> 
>> The edit control is created visible and it's resized to cover the entire client area.
>> 
>> The edit control is used… the text is updated in the [`displayAndLog` function](https://github.com/openjdk/jdk/blob/c38417a86e27f047715cfd9a98770387d994a512/src/jdk.accessibility/windows/native/toolscommon/AccessInfo.cpp#L60).
>> 
>> Since the edit control is a child window, it's automatically destroyed when the parent window is destroyed.
>> 
>> Therefore, there's no reason to store the handle in a variable, and I suggest removing the `hwndEdit` variable.
>> 
>> Moreover, the comment for `hwndEdit`—`// handle of tree-view control`—is confusing because it doesn't store a handle to a TreeView control.
>
> I wonder if this falls into the category of "Can be used in a debugger" like Alex mentioned above, if not I'll remove it

I see no reason to keep.

If it's needed during debugging, there are many ways to find the handle.

Otherwise, the edit control is accessed by its id: `cAccessInfoText`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21656#discussion_r1929205392


More information about the client-libs-dev mailing list