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

Alexey Ivanov aivanov at openjdk.org
Fri Jan 24 20:41:47 UTC 2025


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

>> src/jdk.accessibility/windows/native/jaccesswalker/jaccesswalker.cpp line 561:
>> 
>>> 559:         tvis.item = tvi;
>>> 560: 
>>> 561:         /* HTREEITEM treeNodeItem = */ TreeView_InsertItem(treeWnd, &tvis);
>> 
>> Since it's unused, I'd rather remove the variable altogether.
>> 
>> Does the handle have any other usage except for checking whether an error occurred?
>
> I'm not sure which handle you're referring to, you mean treeNodeItem? It doesn't seem to be used for checking if an error occurred

Yes, `treeNodeItem` has a type of `HTREEITEM` which is an opaque pointer or a handle.

No error checking is performed here, I'm for removing the declaration completely.  
I don't see much value in keeping the variable even for debugging purposes… if needed, it can be quickly added, or the value of `rax` can be viewed after the function call if the debugger doesn't show explicitly the result of the most recent function call.

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

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


More information about the client-libs-dev mailing list