< prev index next > src/java.base/share/classes/jdk/internal/loader/BootLoader.java
Print this page
/*
! * Copyright (c) 2015, 2024, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
/*
! * Copyright (c) 2015, 2025, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
// ClassLoaderValue map for the boot class loader
private static final ConcurrentHashMap<?, ?> CLASS_LOADER_VALUE_MAP
= new ConcurrentHashMap<>();
! // native libraries loaded by the boot class loader
! private static final NativeLibraries NATIVE_LIBS
! = NativeLibraries.newInstance(null);
/**
* Returns the unnamed module for the boot loader.
*/
public static Module getUnnamedModule() {
// ClassLoaderValue map for the boot class loader
private static final ConcurrentHashMap<?, ?> CLASS_LOADER_VALUE_MAP
= new ConcurrentHashMap<>();
! // Holder has the field(s) that need to be initialized during JVM bootstrap even if
! // the outer is aot-initialized.
! private static class Holder {
+ // native libraries loaded by the boot class loader
+ private static final NativeLibraries NATIVE_LIBS
+ = NativeLibraries.newInstance(null);
+ }
/**
* Returns the unnamed module for the boot loader.
*/
public static Module getUnnamedModule() {
/**
* 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.
/**
* Returns NativeLibraries for the boot class loader.
*/
public static NativeLibraries getNativeLibraries() {
! return Holder.NATIVE_LIBS;
}
/**
* Returns {@code true} if there is a class path associated with the
* BootLoader.
< prev index next >