Skip to content

Commit

Permalink
Merge pull request #14694 from JasonFengJ9/bootload-v32
Browse files Browse the repository at this point in the history
(v0.32.0-release) loadClass() continues if findClass via bootstrapClassLoader not succeed
  • Loading branch information
pshipton committed Mar 14, 2022
2 parents d4546b2 + 79a0beb commit 062a216
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions jcl/src/java.base/share/classes/java/lang/ClassLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -1216,16 +1216,15 @@ public final Module getUnnamedModule()
* @exception ClassNotFoundException
* If the class could not be found.
*/
public Class<?> loadClass (String className) throws ClassNotFoundException {
/*[IF Sidecar19-SE]*/
public Class<?> loadClass(String className) throws ClassNotFoundException {
/*[IF JAVA_SPEC_VERSION > 8]*/
if ((bootstrapClassLoader == null) || (this == bootstrapClassLoader)) {
Class<?> cls = VMAccess.findClassOrNull(className, bootstrapClassLoader);
if (cls == null) {
throw new ClassNotFoundException(className);
if (cls != null) {
return cls;
}
return cls;
}
/*[ENDIF] Sidecar19-SE */
/*[ENDIF] JAVA_SPEC_VERSION > 8 */
return loadClass(className, false);
}

Expand Down

0 comments on commit 062a216

Please sign in to comment.