From 4b3c33bac12d8bec47f5a311b6e99bc0b228989d Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Wed, 24 Jun 2020 12:21:51 -0700 Subject: [PATCH] 8247785: Small clarification of the javadoc about builtin class loaders Reviewed-by: alanb, rriggs, dholmes --- .../share/classes/java/lang/ClassLoader.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/java.base/share/classes/java/lang/ClassLoader.java b/src/java.base/share/classes/java/lang/ClassLoader.java index 0ba39b0e64b..6f3eb264c44 100644 --- a/src/java.base/share/classes/java/lang/ClassLoader.java +++ b/src/java.base/share/classes/java/lang/ClassLoader.java @@ -133,11 +133,12 @@ import sun.security.util.SecurityConstants; * It is the virtual machine's built-in class loader, typically represented * as {@code null}, and does not have a parent. *
  • {@linkplain #getPlatformClassLoader() Platform class loader}. - * All platform classes are visible to the platform class loader - * that can be used as the parent of a {@code ClassLoader} instance. - * Platform classes include Java SE platform APIs, their implementation - * classes and JDK-specific run-time classes that are defined by the - * platform class loader or its ancestors. + * The platform class loader is responsible for loading the + * platform classes. Platform classes include Java SE platform APIs, + * their implementation classes and JDK-specific run-time classes that are + * defined by the platform class loader or its ancestors. + * The platform class loader can be used as the parent of a {@code ClassLoader} + * instance. *

    To allow for upgrading/overriding of modules defined to the platform * class loader, and where upgraded modules read modules defined to class * loaders other than the platform class loader and its ancestors, then @@ -151,8 +152,9 @@ import sun.security.util.SecurityConstants; * from the platform class loader. * The system class loader is typically used to define classes on the * application class path, module path, and JDK-specific tools. - * The platform class loader is a parent or an ancestor of the system class - * loader that all platform classes are visible to it.

  • + * The platform class loader is the parent or an ancestor of the system class + * loader, so the system class loader can load platform classes by delegating + * to its parent. * * *

    Normally, the Java virtual machine loads classes from the local file