RFR: 8318091: Remove empty initIDs functions

Daniel Jeliński djelinski at openjdk.org
Fri Oct 27 11:04:36 UTC 2023


On Fri, 27 Oct 2023 10:26:26 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> The removed functions are empty on all platforms.
>> 
>> This patch also removes calls to `Toolkit.loadLibraries();` in classes that no longer have any native methods. The call was needed to ensure that the native awt library is loaded.
>> 
>> Client libs tests passed.
>
> src/java.desktop/share/classes/java/awt/Button.java line 128:
> 
>> 126:     static {
>> 127:         /* ensure that the necessary native libraries are loaded */
>> 128:         Toolkit.loadLibraries();
> 
> I think it is safer to preserve loading the toolkit libraries: `Button` is a peered component and I can't see any of the peers loads the libraries.

Button extends Component, which loads libraries

> src/java.desktop/share/classes/java/awt/FileDialog.java line 146:
> 
>> 144:     static {
>> 145:         /* ensure that the necessary native libraries are loaded */
>> 146:         Toolkit.loadLibraries();
> 
> The same is here: I see no clear path to load the toolkit libraries from the peers, and peers do have native methods, including `initIDs`.
> 
> It looks as if peer implementations depend on the fact that the corresponding public API classes ensure the libraries are loaded.

FileDialog extends Dialog, which loads libraries

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16372#discussion_r1374410255
PR Review Comment: https://git.openjdk.org/jdk/pull/16372#discussion_r1374410900


More information about the client-libs-dev mailing list