--- old/src/java.base/share/classes/jdk/internal/loader/BootLoader.java 2020-03-11 14:25:44.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/loader/BootLoader.java 2020-03-11 14:25:44.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -71,6 +71,10 @@ private static final ConcurrentHashMap CLASS_LOADER_VALUE_MAP = new ConcurrentHashMap<>(); + // native libraries loaded by the boot class loader + private static final NativeLibraries NATIVE_LIBS + = new NativeLibraries(null); + /** * Returns the unnamed module for the boot loader. */ @@ -93,6 +97,13 @@ } /** + * Returns NativeLibraries for the boot class loader. + */ + public static NativeLibraries getNativeLibraries() { + return NATIVE_LIBS; + } + + /** * Returns {@code true} if there is a class path associated with the * BootLoader. */ @@ -129,19 +140,18 @@ } /** - * Loads a library from the system path. + * Loads a native library from the system library path. */ - public static void loadLibrary(String library) { + public static void loadLibrary(String name) { if (System.getSecurityManager() == null) { - SharedSecrets.getJavaLangAccess().loadLibrary(BootLoader.class, library); + BootLoader.getNativeLibraries().loadLibrary(name); } else { - AccessController.doPrivileged( - new java.security.PrivilegedAction<>() { - public Void run() { - SharedSecrets.getJavaLangAccess().loadLibrary(BootLoader.class, library); - return null; - } - }); + AccessController.doPrivileged(new java.security.PrivilegedAction<>() { + public Void run() { + BootLoader.getNativeLibraries().loadLibrary(name); + return null; + } + }); } }