On Fri, 13 Oct 2023 15:19:53 GMT, Daniel Jeliński <djelin...@openjdk.org> wrote:
>> Please review this patch that removes a number of unused exports from >> java.desktop native libraries. >> >> In most cases I removed JNIEXPORT from methods and variables that are only >> used within a single shared library. Other than that: >> - removed `getSunFontIDs` that was reportedly used by rasterizer; as far as >> I could tell, rasterizer project is dead now, but if that's incorrect I can >> restore that export. >> - removed `colorValueID` in X11Color; that field was not used. >> - removed `J2dTraceInit` from header file. That method is only used >> internally by `J2dTraceImpl`. >> >> The methods `Transform_GetInfo` and `Transform_transform` are declared in >> GraphicsPrimitiveMgr, but are only used in TransformHelper. Let me know if I >> should move them to where they are used. >> >> The method `img_makePalette`, currently located in >> `share/native/libawt/awt/image/cvutils/img_colors.c`, is only used by >> `unix/native/common/awt/X11Color.c`; it could be moved to the same directory >> to avoid exporting the method from libawt. The files `img_colors.[ch]` do >> not have any references to other files in `cvutils`. >> >> Manually verified that the exports are no longer present after these >> changes. Tier1-3 and client libs tests still pass. > > Daniel Jeliński has updated the pull request incrementally with seven > additional commits since the last revision: > > - Revert "Remove Color_initIDs" > > This reverts commit 8a8c9a63de14773905a64a8067ddd68c8a6ab137. > - Revert "Remove KeyboardFocusManager_initIDs" > > This reverts commit 66bd9a136b4c34d7d600ad49ce67fcd060160fb8. > - Revert "Remove Rectangle_initIDs" > > This reverts commit 0d21e361cd92215bbc8bb971b5c3f26898b96a0b. > - Revert "Remove Button_initIDs" > > This reverts commit 423afbf3b61cad504ae10a99ceb02c318f3a83ae. > - Revert "Remove FileDialog_initIDs" > > This reverts commit e66a9ffdda6e451c4298f59786adbd434dd1adb5. > - Revert "Remove TextField_initIDs" > > This reverts commit 0c3b78d27b899d4301f8326f90f1cc36703cbd3d. > - Revert "Update copyright" > > This reverts commit 5808c65e5fbabc08b43da982736b40db87000cb5. In general, it looks good. The number of exports has reduced. However, I identified several more exports which don't seem to be used: * `Region_CountIterationRects` * `SurfaceData_IntersectBoundsXYWH` * `mul8table` Could you please verify? In addition to the above, I found a couple of weird cases… * `AWTIsHeadless`: it's defined in `libawt/windows/awt_Toolkit.cpp` as well as in `unix/native/libawt/awt/awt_LoadLibrary.c`. It is exported from `awt.dll` and `libawt.so`. It looks as if its export can be removed from `awt.dll`. It is also exported from `libawt.so` and it's used from `libawt_xawt.so`. * `jvm`: I think it was discussed already. I see it' exported from `libawt.so`, it is imported by `libawt_xawt.so` and `libawt_headless.so`. Or do I misunderstand the split? Is `libawt.so` the common code for both `libawt_xawt.so` and `libawt_headless.so` where the former is headful and the latter is headless? ------------- PR Review: https://git.openjdk.org/jdk/pull/13261#pullrequestreview-1692916643