RFR: 8228773: URLClassLoader constructors should include API note warning that the parent should not be null [v2]
Alan Bateman
alanb at openjdk.org
Thu May 29 13:42:54 UTC 2025
On Thu, 29 May 2025 13:20:28 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
>> src/java.base/share/classes/java/net/URLClassLoader.java line 82:
>>
>>> 80: * @apiNote If the {@code parent} is specified as {@code null} (for the
>>> 81: * bootstrap class loader) then there is no guarantee that all platform
>>> 82: * classes are visible.
>>
>> Should we add a link to `{@linkplain ClassLoader##builtinLoaders ...}` somewhere in this API note?
>>
>>> 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.
>
>>> 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.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25517#discussion_r2113971128
More information about the net-dev
mailing list