<i18n dev> RFR: 8342868: Errors related to unused code on Windows after 8339120 in core libs

Justin Lu jlu at openjdk.org
Wed Oct 30 19:34:09 UTC 2024


On Wed, 30 Oct 2024 17:37:25 GMT, Naoto Sato <naoto at openjdk.org> wrote:

>> The warning received is that got is set but not used - I had a look at getLocaleInfoWrapper and it seems like it has no side effects, its only purpose is to return a value, which is the variable got in this case. I'm pretty certain got not being used is a bug, and that it is needed somewhere, but someone forgot to hook it up to whatever needs it
>
> It does seem a bug, where the return value is not handled correctly. Can you please file a separate bug?

> I had a look at getLocaleInfoWrapper and it seems like it has no side effects, its only purpose is to return a value

While `got` is not needed here, I am not convinced that `getLocaleInfoWrapper` is not used, so we shouldn't comment out all of the code, just remove `got`. `getLocaleInfoWrapper` updates the outbound variable `pattern` (see https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getlocaleinfoex), which is used to get the right string pattern from `fixes`.

Usually, based on `got`, appropriate action is taken, but that's not needed in this case, because `pattern` is either updated or remains its fallback 0 value. So I presume that is why it is ignored in this case.

We could just add that `got` removal to this patch, what do you think @naotoj?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21654#discussion_r1823263389


More information about the i18n-dev mailing list