RFR: 8303814: getLastErrorString should avoid charset conversions [v2]

Daniel Jeliński djelinski at openjdk.org
Mon Mar 13 09:48:27 UTC 2023


On Thu, 9 Mar 2023 18:08:32 GMT, Naoto Sato <naoto at openjdk.org> wrote:

>> Daniel Jeliński has updated the pull request incrementally with three additional commits since the last revision:
>> 
>>  - Address review comments
>>  - Mention that the returned text is static and thread safe
>>  - Define buffer size
>
> src/java.base/share/native/libzip/zip_util.c line 767:
> 
>> 765:  * or NULL if an error occurred. If a zip error occurred then *pmsg will
>> 766:  * be set to the error message text if pmsg != 0. Otherwise, *pmsg will be
>> 767:  * set to NULL. Caller doesn't need to free the error message.
> 
> I'd put some more context here why the caller does not need to free. (as it is a static text)

Added; also mentioned that we want the buffer to be thread-safe. Let me know if that's what you had in mind.

> src/java.base/windows/native/libjava/jni_util_md.c line 80:
> 
>> 78:                 0,
>> 79:                 buf,
>> 80:                 sizeof(buf) / sizeof(WCHAR),
> 
> Maybe better to #define the size 256 so that this division is not needed.

done

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

PR: https://git.openjdk.org/jdk/pull/12922


More information about the serviceability-dev mailing list