RFR: 8228773: URLClassLoader constructors should include API note warning that the parent should not be null [v2]

Jaikiran Pai jpai at openjdk.org
Thu May 29 13:47:56 UTC 2025


On Thu, 29 May 2025 13:40:10 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>>>>   there is no guarantee that all platform classes are visible
>>>
>>> sounds (to me) like the behaviour is undefined (which is not the case). A link to the place where the various class loaders are discussed might clarify that.
>> 
>> Alan's suggestion was that we reuse the existing `@apiNote` from the `java.lang.ClassLoader`'s constructor. So this text was borrowed from that place. 
>> 
>> Alan, do you suggest we should reword this?
>
> I think what you have in the latest commit is good. To address Daniel's comment then we could add another sentence to the API note, something like "See Run-time Built-in Class Loaders for information on the system class loader other and the other built-in class loaders". I think that might work.

> Should we add a link to {@linkplain ClassLoader##builtinLoaders ...} somewhere in this API note?

I think we can add that as a link for "bootstrap class loader". Something like:


 * @apiNote If the {@code parent} is specified as {@code null} (for the
 * {@linkplain ClassLoader##builtinLoaders bootstrap class loader}) then
 * there is no guarantee that all platform classes are visible.


Should we use this?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25517#discussion_r2113989966


More information about the net-dev mailing list