--- old/src/java.instrument/share/classes/java/lang/instrument/Instrumentation.java 2020-04-12 17:30:06.000000000 -0700 +++ new/src/java.instrument/share/classes/java/lang/instrument/Instrumentation.java 2020-04-12 17:30:06.000000000 -0700 @@ -395,12 +395,30 @@ getAllLoadedClasses(); /** - * Returns an array of all classes for which loader is an initiating loader. - * If the supplied loader is null, classes initiated by the bootstrap class - * loader are returned. + * Returns an array of all classes which {@code loader} can find by name + * via {@link ClassLoader#loadClass(String, boolean) ClassLoader::loadClass}, + * {@link Class#forName(String) Class::forName} and bytecode linkage. + * That is, {@code loader} has been recorded as an initiating loader + * of these classes. If the supplied {@code loader} is {@code null}, + * classes that the bootstrap class loader can find by name are returned. + * + *

+ * The returned array does not include {@link Class#isHidden() + * hidden} classes or interfaces that are created by the invocation of + * {@link java.lang.invoke.MethodHandles.Lookup#defineHiddenClass(byte[], boolean, java.lang.invoke.MethodHandles.Lookup.ClassOption...) + * Lookup::defineHiddenClass} because: + *

+ * In addition, the returned array does not include array classes whose + * {@linkplain Class#componentType() element type} is a + * {@link Class#isHidden() hidden class or interface} as they cannot + * be discovered by {@code loader}. * * @param loader the loader whose initiated class list will be returned - * @return an array containing all the classes for which loader is an initiating loader, + * @return an array containing all classes which {@code loader} can find by name; * zero-length if there are none */ @SuppressWarnings("rawtypes")