From 6b2ce5cdcb83b34e5538d3961cc4788672efac5a Mon Sep 17 00:00:00 2001 From: Theresa Mammarella Date: Thu, 9 Jan 2025 13:53:34 -0500 Subject: [PATCH] Add missing update to the shared class cache search path URLClassPath.getResource(String name, boolean check) was removed in 24 due to the security manager removal. The OpenJ9 patch to update the scc's search path was lost because of this change. Signed-off-by: Theresa Mammarella --- .../share/classes/jdk/internal/loader/URLClassPath.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java b/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java index f4630331fcb..22d5fce21de 100644 --- a/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java +++ b/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java @@ -25,7 +25,7 @@ /* * =========================================================================== - * (c) Copyright IBM Corp. 1997, 2023 All Rights Reserved + * (c) Copyright IBM Corp. 1997, 2025 All Rights Reserved * =========================================================================== */ @@ -431,6 +431,9 @@ public Resource getResource(String name) { for (int i = 0; (loader = getLoader(i)) != null; i++) { Resource res = loader.getResource(name); if (res != null) { + res.setClasspathLoadIndex(i); /* Store the classpath index that this resource came from. */ //OpenJ9-shared_classes_misc + /* Update the search path with shared Classes Helper, this is only if we are using shared classes. */ //OpenJ9-shared_classes_misc + updateClasspathWithSharedClassesHelper(i); //OpenJ9-shared_classes_misc return res; } }