RFR: 8308780: Fix the Java Integer types on Windows [v9]

Alexey Ivanov aivanov at openjdk.org
Fri Jun 23 14:27:10 UTC 2023


On Fri, 23 Jun 2023 00:16:45 GMT, Julian Waters <jwaters at openjdk.org> wrote:

>> src/java.desktop/windows/native/libawt/windows/awt_MenuBar.cpp line 148:
>> 
>>> 146: }
>>> 147: 
>>> 148: AwtMenuItem* AwtMenuBar::GetItem(jobject target, jint index)
>> 
>> What is the reason for using `jint` instead of `int`?
>> 
>> The member function is used in for-loop which iterates with `int` loop variable. Yet the implementation of `GetItem` up-calls into Java.
>
> I had it as a jint since it upcalls into Java

I am fine with either way as long as it compiles without warning and menu works as expected.

I had to ask the question. Which way conveys the intention clearer? I don't know. I incline to using `int` as is in the latest version.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14125#discussion_r1239883713


More information about the core-libs-dev mailing list