Skip to content
Closed
Changes from 1 commit
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
8 changes: 1 addition & 7 deletions test/hotspot/jtreg/compiler/jvmci/LoadAlternativeJVMCI.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
import java.net.URL;
import java.net.URI;
import java.net.URLClassLoader;
import java.lang.reflect.*;

import jdk.internal.loader.ClassLoaders;

public class LoadAlternativeJVMCI {
public static void main(String[] args) throws Exception {
Expand All @@ -53,11 +50,8 @@ public static void main(String[] args) throws Exception {
cp[i] = new URI("file:" + e).toURL();
Copy link
Contributor

@AlanBateman AlanBateman Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be cp[i] = file.toURI().toURL() as a file path needs encoding to be URI path component.

}

Field blField = ClassLoaders.class.getDeclaredField("BOOT_LOADER");
blField.setAccessible(true);
ClassLoader boot = (ClassLoader) blField.get(null);
URLClassLoader ucl = new URLClassLoader(cp, boot);
ClassLoader pcl = ClassLoader.getPlatformClassLoader();
URLClassLoader ucl = new URLClassLoader(cp, null);

String[] names = {
"jdk.vm.ci.meta.ResolvedJavaType",
Expand Down