Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,30 @@

import com.oracle.svm.core.annotate.Substitute;
import com.oracle.svm.core.annotate.TargetClass;
import com.oracle.svm.core.hub.ClassForNameSupport;
import com.oracle.svm.core.jdk.JDK11OrLater;

/*
* The `hasClassPath()` method substitution from this class is required to work around a NPE when `BootLoader.hasClassPath()`
* is called. This was fixed in a GraalVM commit (https://github.com/oracle/graal/commit/68027de) which will be backported to
* 19.3.1. We copied the entire GraalVM commit content into Quarkus for the sake of consistency.
* See https://github.com/oracle/graal/issues/1966 for more details about the NPE.
*/
@TargetClass(className = "jdk.internal.loader.BootLoader", onlyWith = JDK11OrLater.class)
final class Target_jdk_internal_loader_BootLoader {

/*
* The following substitution is required to work around a NPE that happened when `BootLoader.loadClassOrNull(name)` was
* called during the Quarkus native integration tests execution. It will be directly fixed in a future GraalVM release
* which is undetermined for now. This substitution should be removed as soon as Quarkus depends on a GraalVM version that
* includes the fix.
*/
@Substitute
private static Class<?> loadClassOrNull(String name) {
return ClassForNameSupport.forNameOrNull(name, false);
}

/*
* The following substitution is required to work around a NPE that happened when `BootLoader.hasClassPath()` was called
* during the Quarkus native integration tests execution. It was fixed in a GraalVM commit which should be backported to
* 19.3.1 (https://github.com/oracle/graal/commit/68027de). This substitution should be removed as soon as Quarkus depends
* on a GraalVM version that includes that commit.
* See https://github.com/oracle/graal/issues/1966 for more details about the NPE.
*/
@Substitute
private static boolean hasClassPath() {
return true;
Expand Down