Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URLClassLoaderTests NonExistJarTests.CheckForError1 fails from SecurityManager removal #20702

Open
theresa-m opened this issue Nov 28, 2024 · 1 comment

Comments

@theresa-m
Copy link
Contributor

theresa-m commented Nov 28, 2024

This test is disabled in #20625 and requires further investigation.

URLClassLoader previously relied on java.security.AccessController to determine whether or not a class to be loaded can be found on the classpath. NonExistJarTests.CheckForError1 tests that class B_Dummy that is loaded in the shared class cache but is not on the classpath is not loaded and should result in:

CORRECT A
Exception in thread "main" java.lang.NoClassDefFoundError: jnurlcldr.shared.nonexistjar.B_Dummy
        at jnurlcldr.shared.nonexistjar.A_Main$Data.getInt(A_Main.java:33)
        at jnurlcldr.shared.nonexistjar.A_Main.main(A_Main.java:47)
Caused by: java.lang.ClassNotFoundException: jnurlcldr.shared.nonexistjar.B_Dummy
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:827)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:1099)
        ... 2 more

With the latest JEP 486 changes the classpath check is not enforced and B_Dummy is retrieved from the scc.

Related to: #20563

Copy link

Issue Number: 20702
Status: Open
Recommended Components: comp:test, comp:jclextensions, comp:vm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant