--- old/src/java.base/share/classes/jdk/internal/loader/BootLoader.java 2020-03-09 21:45:18.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/loader/BootLoader.java 2020-03-09 21:45:18.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,23 +140,6 @@ } /** - * Loads a library from the system path. - */ - public static void loadLibrary(String library) { - if (System.getSecurityManager() == null) { - SharedSecrets.getJavaLangAccess().loadLibrary(BootLoader.class, library); - } else { - AccessController.doPrivileged( - new java.security.PrivilegedAction<>() { - public Void run() { - SharedSecrets.getJavaLangAccess().loadLibrary(BootLoader.class, library); - return null; - } - }); - } - } - - /** * Returns a URL to a resource in a module defined to the boot loader. */ public static URL findResource(String mn, String name) throws IOException {