Review Request JDK-8228336: Refactor native library loading implementation
Mandy Chung
mandy.chung at oracle.com
Wed Mar 11 21:43:28 UTC 2020
On 3/11/20 10:25 AM, Daniel Fuchs wrote:
> Hi Mandy,
>
> On 11/03/2020 16:10, Alan Bateman wrote:
>>> I'm open to other suggestion. This helper method avoids the call to
>>> doPrivileged when security manager is enabled and I think it's okay
>>> to add this helper method in sun.security.action package.
>> BootLoader defines methods to correspond to the methods defined by
>> ClassLoader so I don't think the loadLibrary method was too bad.
>> Moreover it was very clear when calling BootLoader.loadLibrary that
>> it would attempt to load it from the system path. I don't object to
>> putting this in sun.security.action but it doesn't feel. If it is
>> moved but I think we'll need to find better names so it's clear in
>> the 20+ places where it used (and also avoid the temptation to use it
>> in the modules that aren't mapped to the boot loader).
>
> That's probably a stupid question but wouldn't it have been simpler to
> redefine BootLoader::loadLibrary(String) to call the new
> LoadLibraryAction rather than removing the method altogether?
Thanks for the feedback.
I discussed further with Alan. Other class and names are no better
than BootLoader::loadLibrary. We agree to keep that helper method as
BootLoader::loadLibrary. The changes due to the renaming is reverted.
Updated patch:
http://cr.openjdk.java.net/~mchung/jdk15/webrevs/8228336/webrev.02/
Mandy
More information about the core-libs-dev
mailing list